|
Posted by Els on 03/31/07 11:40
patrick j wrote:
> 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>
Oops! Bad code :-)
> iCab complains that the <ul> for the nested list should not be there.
iCab is correct.
> Removing the </li> immediately prior to the nested <ul> sorts this out, so
> iCab is happy with what is below:
[snip]
> <li><a href="#">link</a>
> <ul>
> <li><a href="#">link</a></li>
[snip]
> </ul
> <li><a href="#">link</a></li>
If iCab likes that, it's missing a spot..
> I notice that at the rather excellent Max Design tutorials on lists they
> leave out the </li> immediately prior to a nested list.
No, they don't leave it out - they place it in the right place.
> You can see this here:
>
> <http://css.maxdesign.com.au/listamatic2/vertical01.htm>
Exactly. That's correct code :-)
> So it would suggest it's not just the iCab verification system that doesn't
> like it.
True.
> But it doesn't seem to make sense to leave out that </li> before the nested
> list.
It does. The nested ul is not nested if it's not inside the <li>
element.
The correct code is:
<ul>
<li>....</li>
<li>....
<ul>
<li>...</li>
<li>...</li>
</ul>
</li>
etc.
See the closing </li> after the nested <ul>?
A nested list, is a child of a list item.
--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Navigation:
[Reply to this message]
|