Re: Validations..Help!!
by "Rayne Alburquerque" <rayneal(at)home.com>
|
Date: |
Tue, 22 Feb 2000 15:20:46 -0600 |
To: |
"Donna M Smillie" <dms(at)zetnet.co.uk>, <hwg-basics(at)hwg.org> |
References: |
default co |
|
todo: View
Thread,
Original
|
|
I have a question about the <li> tags. Here is the code:
<ul>
<li>Item 1</li>
<li>
<ul>
<li>Item 1 sub</li>
</ul>
</li>
<li>Item 2</li>
</ul>
Can anyone explain what is wrong with the code that would cause the
validation error? It tells me that the inside <ul> tag is not valid where
placed. When taking out the end <li> tag for the nested list, It validated
correctly.
If they are optional, shouldn't it work?
Thanks,
Rayne
rayneal(at)home.com
----- Original Message -----
From: Donna M Smillie
To: hwg-basics(at)hwg.org
Sent: Tuesday, February 22, 2000 2:28 PM
Subject: Re: Validations..Help!!
----- Original Message -----
> >Line 71, column 3:
> > <br>
> > ^
> >Error: start tag for "LI" omitted, but its declaration does not
permit
> this
>
> The <LI> element is a singleton tag, so maybe you have a closing end
tag
> </LI> at the end?
Sorry, had to come in on this - LI is one of those tags where the end
/LI tag is listed as optional in HTML 4. So it's OK to have a /LI tag
at the end of the list item. In fact, if you want to nest lists inside
lists it's advisable to use the corresponding /LI tags to keep
everything straight.
The validation error above must have been as a result of using a BR tag
inside a list (eg UL or OL) but outside of opening and closing LI /LI
tags. Eg:
<ul>
<li>list item one</li>
<br>
<li>list item two</li>
</ul>
Instead, what you should do is:
<ul>
<li>list item one<br><br></li>
<li>list item two</li>
</ul>
Regards,
Donna
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA