Reputation: 65
The following menu works really fine in the browser, but I cant get it to validate as XHTML. I took this example out of my CSS Book. It says it is right, but seemingly it is not.
<ul id="leftNavi">
<li>
<a href="#" class="SCL">left menu1</a>
</li>
<li class="SCNL">left menu2</li>
<ul id="subnavi">
<li>
<a href="#" class="inactive">menu2/1</a>
</li>
<li>
<a href="#" class="inactive">menu2/2</a>
</li>
<li>
<a href="#" class="inactive">menu2/3</a>
<li>
</ul>
<li>
<a href="#" class="HCL">left menu3</a>
</li>
</ul>
Here a link to the page: http://www.yiip.de/arbeit/testlayout/standard_template.html I am talking about the left menu.
Upvotes: 3
Views: 5332
Reputation: 625077
<ul id="leftNavi">
<li ><a href="#" class="SCL">left menu1</a></li>
<li class="SCNL">left menu2
<ul id="subnavi">
<li><a href="#" class="inactive">menu2/1</a></li>
<li><a href="#" class="inactive">menu2/2</a></li>
<li><a href="#" class="inactive">menu2/3</a></li>
</ul>
</li>
<li><a href="#" class="HCL">left menu3</a></li>
</ul>
You had a couple of problems:
<li>
element; andsubnav1
list wasn't contained within a <li>
element. It can't be a direct child of another list, which was the main problem with validating your HTML.Upvotes: 13