You are here: Re: Why use a /> at the end of a statement? « HTML « IT news, forums, messages
Re: Why use a /> at the end of a statement?

Posted by Mike Barnard on 03/04/07 11:01

On Sat, 03 Mar 2007 18:16:47 +0000, Steve Pugh <steve@pugh.net> wrote:
>>I have been examining the code of a site and often, not always, there
>>is a slash before the end of a statement.
>>
>><br class="clear" />

>>Why is it needed, if it is needed, and what is it good for? I
>>understand </p> </h1> etc but why a /> alone?

>It's required in XHTML. Why? Because one of the restrictions of XML
>over SGML and hence of XHTML over HTML is that all elements must be
>expclitl closed. Which means both that all those optional closing tags
>like </p> and </li> become mandatory, and that empty elements must
>close themselves and the XML syntax for that is <br />.
>
>In practical terms it just boils downs to:
>If you use XHTML use <br />, <img />, etc.
>If you use HTML use <br>, <img>, etc.

As said to others, thanks for the help. I'm (slowly) getting there.

 

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

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