SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast jester_original's Avatar
    Join Date
    Aug 2004
    Location
    devon
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Validation Issue

    Hi guys & gals,

    Have got my navagation working nicley in ie and mozz.
    Now i am trying to get it validated in xhtml.
    here is the code:

    <div style="font-size:12px; color#000000; font-family:Arial; padding:30px;">
    <!-- ********************************** Effect Structure and Links ************************************** -->
    <!--<div style="z-index:1;position:relative;">-->
    <div style="display:none;">
    <ul id="imenus0">
    <li style="width:140px;"><a href="#">Who We Are</a>
    <div>
    <ul style="width:140px;top:0px;left:0px;">
    <li>
    <div>
    <li ><a href="dump.htm">Overview</a></li>
    <li ><a href="sample_link.html">Mission &amp; Goals</a></li>
    <li ><a href="sample_link.html">History</a></li>
    <li ><a href="sample_link.html">Management</a></li>
    <li ><a href="sample_link.html">Working at Tyco</a></li>
    <li ><a href="sample_link.html">Press Center</a></li>
    <li ><a href="#">Worldwide</a></li>
    <li ><a href="#">Board of Directors</a></li>
    <li ><a href="#">Worldwide</a></li>
    <li ><a href="#">Customers</a></li>
    </div>
    </ul>
    </div>
    </li>


    <li style="width:125px;"><a href="#">Investors</a>
    <div>
    <ul style="width:126px;top:;left:;">
    <div>
    <li ><a href="sample_link.html">Overview</a></li>
    <li ><a href="sample_link.html">Stock Quotes</a></li>
    </div>
    </ul>
    </div>
    </li>

    <li style="width:125px;display:block;"><a href="sdfs.htm">No Drop</a>
    <div style="display:none;">
    <ul style="width:126px;top:;left:;">
    <div>
    </div>
    </ul>
    </div>
    </li>

    </ul>

    when i run this, i get this error:

    document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

    Am i blind?
    Its one of those days!

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't nest a DIV inside an LI, as it is a block level element. Change the DIVs to SPANs with "display: block" if you need them.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep. an UL can only contain LI elements as its immediate children, nothing else.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •