Inga.
12-12-2008, 09:00 AM
I made my first site that was all layers with css rather than using tables here and there finally. Everything looks just fine but the W3C validation tool says I have done something wrong with my menu using the <li> tag. I'm not really sure what I've done wrong and don't quite understand the validation error message.
I get this message:
Line 25, Column 7: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag.
<li>Start</li>
✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
The code for the menu is:
<div id="nav01"> <!-- TemplateBeginEditable name="navbar" -->
<li><a href="../index.html">Start</a></li>
|
<li><a href="../valkommen.html">Välkommen</a></li>
|
<li><a href="../tuina.html">Vad är Tui Na?</a></li>
|
<li><a href="../meridianer.html">Meridianer</a></li>
|
<li><a href="../behandling.html">Behandling</a></li>
|
<li><a href="../varfinnsjag.html">Var finns jag?</a></li><!-- TemplateEndEditable -->
</div>
And my css for it is:
.twoColHybLtHdr #nav01 {
text-align:center;
color: #6d6e71;
font-weight:500;
vertical-align:top;
padding: 0 0;
}
.twoColHybLtHdr #nav01 li {
list-style: none;
display: inline;
color: #817c00;
font-weight:500;
}
.twoColHybLtHdr #nav01 a {
text-decoration: none;
color: #6d6e71;
}
.twoColHybLtHdr #nav01 a:hover {
text-decoration: underline;
}
I get this message:
Line 25, Column 7: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag.
<li>Start</li>
✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
The code for the menu is:
<div id="nav01"> <!-- TemplateBeginEditable name="navbar" -->
<li><a href="../index.html">Start</a></li>
|
<li><a href="../valkommen.html">Välkommen</a></li>
|
<li><a href="../tuina.html">Vad är Tui Na?</a></li>
|
<li><a href="../meridianer.html">Meridianer</a></li>
|
<li><a href="../behandling.html">Behandling</a></li>
|
<li><a href="../varfinnsjag.html">Var finns jag?</a></li><!-- TemplateEndEditable -->
</div>
And my css for it is:
.twoColHybLtHdr #nav01 {
text-align:center;
color: #6d6e71;
font-weight:500;
vertical-align:top;
padding: 0 0;
}
.twoColHybLtHdr #nav01 li {
list-style: none;
display: inline;
color: #817c00;
font-weight:500;
}
.twoColHybLtHdr #nav01 a {
text-decoration: none;
color: #6d6e71;
}
.twoColHybLtHdr #nav01 a:hover {
text-decoration: underline;
}