Re: Nesting Lists
by Andrew McFarland <aamcf(at)aamcf.co.uk>
|
Date: |
Thu, 23 May 2002 22:58:29 +0100 |
To: |
hwg-basics(at)hwg.org |
In-Reply-To: |
localhost |
|
todo: View
Thread,
Original
|
|
At 17:21 23/05/02 -0400, Thomas Rumley wrote:
>First, there is no need to close list items (<LI>).
This is only true for HTML. XHTML requires that all elements are closed.
>It's simply a waste of time and does nothing for you.
Well, not entirely true. An HTML document with implicitly closed elements -
ie missing optional end tags - is more difficult to parse and hence slower
to render. Adding all optional end tags makes the parsing easier, and you
are less likely to get confused yourself - and its essential to have an
accurate mental parse tree for a document if you are going to use CSS.
Closing end tags make a page more maintainable too.
>When the browser hits a second <LI> or closing </ol> is assumes a closing
>list item tag.
Why make the browser do all of this extra work - and it is a surprising
amount of extra work - every time the page is displayed? Why not just do
the tiny amount of extra work _yourself_ when you create the page?
Omitting optional tags in HTML is one of those ideas that looks good but
actually causes problems. If you are writing HTML always close your tags.
Or, better still, stop writing HTML and move onto XHTML. :-)
Andrew
--
http://aamcf.co.uk/
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA