deathshadow60
Actually, in HTML (up to and including HTML 4.01), a / will close the latest tag left open. One example would be the following:
This is equivilant to the following:Code html4strict:<p/This is a paragraph/ <p/This is another paragraph/ <!-- ignore the following code - SitePoint is having problems with null end tags, it seems ;) --> >>
The disadvantage is, of course, that you can't use a / without escaping it.Code html4strict:<p>This is a paragraph</p> <p>This is another paragraph</p>
Since the > doesn't have to be escaped, unlike the < and the &, this syntax:
is equivilant toCode html4strict:<p/> means greater than/
Code html4strict:<p>> means greater than</p>
There are also other SGML shorthand methods. A few examples can be seen in my signature, which is equivilant to:
Code html4strict:<p><strong><abbr>HTML</abbr> 4 teh win</strong></p> <p>In Soviet Russia, website codes you!</p>
Unfortunately, no mainstream user agents actually conform to this. Still, the official HTML validator will correctly validate such shorthand syntax.



Reply With Quote
-- though yes, 4.01 tried to be more SGML compliant and for true 4.01 compliance a browser should treat HTML as SGML, but since 2 and 3.2 didn't have that browser makers really didn't see the point.



Bookmarks