|
Posted by David Dorward on 08/03/07 15:37
On Aug 3, 4:30 pm, Jeff Dege <jd...@jdege.visi.com> wrote:
> Now try a third bit of html:
>
> <div id="first">
> <div id="second" />
> <div id="third" />
> </div
>
> I'd expect this to draw exactly the same as the second example, above.
> We've made no substantive changes from it. Instead, it draws the same as
> the first - as if the third div is nested within the second div. Which
> it isn't, according to everything I thought I understood about how SGML
> parsing worked.
In HTML <div /> means the same as <div>>.
I believe SGML can cause it to mean the same as <div></div> (and that
is the case for XML), but the declaration for HTML isn't set up that
way.
Additionally, browsers use tag soup slurpers and not real SGML
parsers, so <div /> actually gets treated as <div>.
You've basically got two missing end tags in that last example.
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Navigation:
[Reply to this message]
|