Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   General Discussions (http://forums.winamp.com/forumdisplay.php?f=1)
-   -   html help v3 (http://forums.winamp.com/showthread.php?t=250912)

tuckerm 11th July 2006 23:09

html help v3
 
Working on a weather site for my site...not working out very well so i need some help.

First off, is the image tag <img src="image url here"> or <img src="image url here"/>

Second heres the problem:

www.msrlive.net/weather/7day.htm

If you look the fox 9 thing is supposed to be below the other one. I'm using <BR> tags but they arnt doing anything. Anyone know why?

Thanks :)

- Tucker

Razzinno 11th July 2006 23:20

The one time you used <p><p> and you got the result you wanted, right? Take out the <br><br> and use <p><p> again. What will that do?

tuckerm 11th July 2006 23:48

Nope. It doesnt work, i need it like this:

<img src="wcco 7 day"><BR><BR>
Fox 9's 7 Day:<BR>
<img src="fox 9's image:><BR><BR>

And so one. But its not taking my <BR>s

psyfive 11th July 2006 23:53

put a &amp;nbsp; between the <br>

Reaper 12th July 2006 16:32

If you're going to use XHTML, it has to be <br /> and lowercase (iirc). You're also forgetting a few things in your html element. It should look like this:

PHP Code:

<!DOCTYPE html 
     
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"

Also, I know I'm being nitpicky on this one but img elements need alt="" attributes.

http://validator.w3.org/check?verbos...her%2F7day.htm

[edit]
The img element also has to be closed in XHTML. <img alt="" src="" />

PulseDriver 12th July 2006 22:45

and all attributes needs to be enclosed with " and ", short-attributes is not allowed, such as foo=bar it should be foo="bar"

also need to use endtag for you <br>, no uppercase tag names such as <BR>, not allowed in XML, nor attributes, such as FOO="bar".

For it to truly be XML or XHTML if you like you need to add an XML tag to the document as well, <?xml>

zootm 12th July 2006 22:51

Quote:

Originally posted by PulseDriver
also need to use endtag for you <br>, no uppercase tag names such as <BR>, not allowed in XML, nor attributes, such as FOO="bar".
Capitals are allowed in XML, but since it's case-sensitive the tags for XHTML are all normalised to lower-case.

I'm not convinced XHTML is hugely beneficial in this case.

PulseDriver 13th July 2006 15:27

And don't use <p> (paragraph) for line breaks, that's not it's purpose. Use <p> for paragraphs such as

PHP Code:

<class="article">This is an article</p

For optimal code, you should never have to actually use <br> at all, unless it's a very special case. If you write several paragraphs you should use code like this instead:

PHP Code:

<class="article">This is an article</p>
<
class="article">This is another article</p

For precicision position of objects or areas, use code like this:
PHP Code:

<body>
  <
div id="page_container">
    <
div id="page_header">
      <
h1>Main Header</h1>
    </
div>
    <
div id="page_content">
      <
h2>Article header</h2>
      <
p>This is an article</p>
      <
h2>Another article header</h2>
      <
p>This is another article</p>
    </
div>
    <
div id="page_menu">
       <!-- 
Menu items for this page-->
    </
div>
    <
div id="static_menu">
       <!-- 
Menu items you want on all pages -->
    </
div>
  </
div>
</
body

Then place all the divs with dynamic or fixed or absolute positions.

zootm 13th July 2006 16:51

Quote:

Originally posted by PulseDriver
For optimal code, you should never have to actually use <br> at all, unless it's a very special case. If you write several paragraphs you should use code like this instead:
Mid-paragraph linebreaks are acceptable, in my opinion. They're often useful, I find, although it sounds weird.

PulseDriver 13th July 2006 17:14

If you find it useful, do this instead

PHP Code:

<head>
  <
style type="text/css">
    
br.useful{
      
displayblock;
      
height3em;
    }
  </
style>
</
head>
<
body>
  <
h1>Header</h1>
  <
h2>Article</h2>
  <
p>This is an article and this is the 
    first line of it
.<br class="usefull" />
    
This is the second line.</p>
</
body

Even though a webpage can be created with so much dynamics and different appearances due to browser and writer of the page, one should always use the tags for it's right purpose.

Such as instead of writing

PHP Code:

  <p>use <i>italic</ito show the reader it's a keyword.</p> 

You should use:
PHP Code:

<style>
  
em.important{
    
font-styleitalic;
  }
</
style

Then call it with the class like this:

PHP Code:

<p>use <em class="important">CSS</emto show the reader it's a keyword</p> 

Now with CSS2, you can customize your own tags and classes much the way you want when it comes to dimenstions and sizes and anything that makes other content move to make space for it. ;)

Mattress 13th July 2006 17:31

Re: html help v3
 
Quote:

Originally posted by tuckerm
Second heres the problem:

www.msrlive.net/weather/7day.htm

If you look the fox 9 thing is supposed to be below the other one. I'm using <BR> tags but they arnt doing anything. Anyone know why?

Thanks :)

- Tucker

in your style sheet:
code:
body img {
display: block;
float: left;
}


this is making all of you images float to the left. Meaning they are left aligned and text should flow around them when possible.

Get rid of those <br> tags and Put this tag around thatFox 9 text:
code:

<div style="clear:both;">Fox 9 KMSP:</div>


PulseDriver 13th July 2006 17:37

Re: Re: html help v3
 
Quote:

Originally posted by Mattress

code:

<div style="clear:both;">Fox 9 KMSP:</div>


OMG inline style :P

Mattress 13th July 2006 17:43

OMG who gives a fuck?

He want's it to work not to be ulta beautiful code. Nobody looks at the code.

PulseDriver 13th July 2006 17:47

No but using inline style kinda removes the power of the CSS a great deal. ;)

You'd have to rewrite the CSS if you want the same style somewhere else on the page, and you can't use it on multiple pages either :P

zootm 13th July 2006 17:48

Quote:

Originally posted by PulseDriver
If you find it useful, do this instead

PHP Code:

<head>
  <
style type="text/css">
    
br.useful{
      
displayblock;
      
height3em;
    }
  </
style>
</
head>
<
body>
  <
h1>Header</h1>
  <
h2>Article</h2>
  <
p>This is an article and this is the 
    first line of it
.<br class="usefull" />
    
This is the second line.</p>
</
body


No need for the class there. It reeks of putting layout into the content too - why're you using a class on a <br>? If it's because you want it to be a different size than an ordinary <br>, you're putting layout into the code, which is bad practice.

Quote:

Originally posted by PulseDriver
Even though a webpage can be created with so much dynamics and different appearances due to browser and writer of the page, one should always use the tags for it's right purpose.

Such as instead of writing

PHP Code:

  <p>use <i>italic</ito show the reader it's a keyword.</p> 

You should use:
PHP Code:

<style>
  
em.important{
    
font-styleitalic;
  }
</
style

Then call it with the class like this:

PHP Code:

<p>use <em class="important">CSS</emto show the reader it's a keyword</p> 


No need for the class there either. Emphasis implies something is important. If you want to shift all your semantics into classes, why not just use <span> for everything?

A more sensible use of classes would probably be to style your paragraphs and their subelements using classes, so you cut down on faff.

PHP Code:

<style>
  
p.content_paragraph em
  
{
    
font-styleitalic;
  }
  
p.content_paragraph em.really_important
  
{
    
font-sizelarge
  }
</
style

...
PHP Code:

<class="content_paragraph">Wowthis is <em>awesome</em>, and I mean <em class="really_important">awesome</em>!</p

Unless you're trying to apply a certain type of emphasis, leave emphasis tags blank. Putting unnecessary classes on everything can make your code real ugly.

Leave class tags out where they don't add anything, is all I'm trying to say. They're supposed to attach extra semantic meaning to elements. If there's none to add, don't add any.

PulseDriver 13th July 2006 17:51

Yes span is okay too, just that <p> wasn't made for linebreaks, span is good. Indeed. And I know <em> implies something important, just showing how to customize it ;)

zootm 13th July 2006 17:54

Quote:

Originally posted by PulseDriver
Yes span is okay too, just that <p> wasn't made for linebreaks, span is good. Indeed. And I know <em> implies something important, just showing how to customize it ;)
Yeah, I was just worried that your examples were kinda implying that everything should have a class, which is really, really not the case, and that the <br> one was putting layout into content.

PulseDriver 14th July 2006 14:07

Yes, you are right, most cases it would be natural to just use

PHP Code:

<p>This is a <em>keyword</em>.</p

and then use css to suit your "theme" with CSS like

PHP Code:

<style type="text/css">
  
em{
    
colorblack;
  }
</
style

Or any other color, font, font-decoration, font-weight or font-style you need or want. Point is, know what your tags are for. :)


All times are GMT. The time now is 08:49.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.