You are here: Re: Paragraph and DIV usage in XHTML « HTML « IT news, forums, messages
Re: Paragraph and DIV usage in XHTML

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>&nbsp;</p>
> <p />
> <p class="spacer"></p>
> <p class="spacer">&nbsp;</p>
> <p class="spacer" />
>
> ...and I've the same question for DIV...
>
> <div></div>
> <div>&nbsp;</div>
> <div />
> <div class="spacer"></div>
> <div class="spacer">&nbsp;</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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация