|
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]
|