You are here: The </li> before a nested list. Why not? « HTML « IT news, forums, messages
The </li> before a nested list. Why not?

Posted by patrick j on 03/31/07 11:29

Hi

I'm wondering about lists with nested lists as one does on a Saturday
afternoon.

Anyway below is an example of a list with a nested list which the iCab
browser's very useful HTML verification ability will not like:

<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>

iCab complains that the <ul> for the nested list should not be there.
Removing the </li> immediately prior to the nested <ul> sorts this out, so
iCab is happy with what is below:

<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a>
<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>

I notice that at the rather excellent Max Design tutorials on lists they
leave out the </li> immediately prior to a nested list.

You can see this here:

<http://css.maxdesign.com.au/listamatic2/vertical01.htm>

So it would suggest it's not just the iCab verification system that doesn't
like it.

But it doesn't seem to make sense to leave out that </li> before the nested
list.

I'd be grateful if someone could explain why it is so?

Thank you :)



--
Patrick - Brighton, UK
If you wish email me from my web-site: <http://www.patrickjames.me.uk>
Inventory service in Sussex: <http://www.inventoryworks.co.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

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