Posted by Steve Pugh on 10/24/06 15:27
tzuchia16@yahoo.com wrote:
> I'd like anyone's thoughts on which of the following would be the
> correct manner of coding for XHTML.
>
> <p></p>
> <p> </p>
> <p />
> <p class="spacer"></p>
> <p class="spacer"> </p>
> <p class="spacer" />
>
> ...and I've the same question for DIV...
>
> <div></div>
> <div> </div>
> <div />
> <div class="spacer"></div>
> <div class="spacer"> </div>
> <div class="spacer" />
None of the above.
<p /> and <div /> are wrong if you'res erving your XHTML as text/html
The rest aren't technically wrong but make no semantic sense and should
be avoided - what does an empty paragraph mean?
> I've seen it done with the variations above. Just curious as to which
> is the proper method. Oh, and my goal with divs would be just to space
> between items (I've noticed that it's a bit smaller than the Paragraph
> tag).
Set margins via CSS instead.
Steve
[Back to original message]
|