You are here: Re: Layout of self-closing divs - can anyone explain this? « HTML « IT news, forums, messages
Re: Layout of self-closing divs - can anyone explain this?

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>&gt;.

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]


Удаленная работа для программистов  •  Как заработать на 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

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