ul ol nesting error

Discussion in 'CSS' started by SOcRatEs, May 3, 2006.

  1. #1
    Hello!
    I hope I've posted in right forum.
    Can you spot what I did wrong with nesting OL with UL?
    My ul nav buttons got wierd when I started nesting OL.
    I now have "1." on leftside of buttons

    My OL listing came out right correct:
    1.
    2.
    --2.1
    ----2.1.1
    3.
    4.
    --4.1
    I think maybe triple nesting may have hosed it.

    http://www.my-yardsale.com----page with errors

    Thank you to anyone who can help!!
    layout.css
    #button {
    	width: 12em;
    	border-right: 1px solid #000;
    	padding: 0 0 1em 0;
    	margin-bottom: 1em;
    	font-family: 'Trebuchet MS', 'Lucida Grande',
    	  Verdana, Lucida, Geneva, Helvetica, 
    	  Arial, sans-serif;
    	background-color: #808080;
    	color: #333;
    	}
    #button ul {
    		list-style: none;
    		margin: 0;
    		padding: 0;
    		border: none;
    		}
    		
    	#button li {
    		border-bottom: 1px solid #DDDDDD;
    		margin: 0;
    		}
    #button li a {
    		display: block;
    		padding: 5px 5px 5px 0.5em;
    		border-left: 10px solid #4B4B4B;
    		border-right: 10px solid #508fc4;
    		background-color: #666666;
    		color: #000000;
    		text-decoration: none;
    		width: 100%;
    		}
    
    	html>body #button li a {
    		width: auto;
    		}
    
    	#button li a:hover {
    		border-left: 10px solid #646464;
    		border-right: 10px solid #C0C0C0;
    		background-color: #969696;
    		color: #242424;
    !<----head:---->
    <style type="text/css">
    body {
    background-image:
    url('images/bg22.jpg');
    background-attachment: fixed;
    }
    ol { counter-reset: item }
    li { display: block }
    li:before { content: counters(item, ".") ". "; counter-increment: item 
    }
    </style>
    </head>
    !-- left column -->
    <div id="lh-col"><br />
    <h3 align="center">Navigation</h3>
    <br />	  
    <div id="button">
    <ul id="button ul">
    
    	<li><a href="index.html">Home</a></li>
    	<li><a href="2.html">Contacts</a></li>
    	<li><a href="3.html">About Us</a></li>
    	<li><a href="http://my-yardsale.com/phpBB2/index.ph">Arizona's Yard Sale</a></li>
    	<li><a href="4.html">Terms of Use</a></li>
    	<li><a href="5.html">Prohibited Items</a></li>
    	<li><a href="6.html">Affiliates</a></li>
    	<li><a href="region.html">Yard Sales by State</a></li>
    </ul>
    </div>
    <br />
    </div>
    <!-- end of left column -->
    <!----Center col---->
    <ol>
       <li>Category One</li>
       <li>Category Two     <----Note: No Closing List Tag
          <0l>
              <li>Sub-Category One</li>
              <li>Sub-Category Two     <----Note: No Closing List Tag
                  <ol>
                     <li>Sub-Sub-Category One</li>
                     <li>Sub-Sub-Category Two</li>     <----Note: Closing List Tag
                  </ol></li>           <----Note: Nested List Closed
               <li>Sub-Category Three</li>
          </ol></li>       <----Note: Nested List Closed
        <li>Category Three</li>
    </ol>      <----Note: End of entire list
    <!----end Center col---->
    Code (markup):
     
    SOcRatEs, May 3, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    What have I missed? I don't see any nested lists, ul nor ol.

    cheers,

    gary
     
    kk5st, May 3, 2006 IP
  3. Huvet

    Huvet Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    You have written zero-L instead of OL... "<0l>" is not the same as "<ol>" (look at the second level).
     
    Huvet, May 3, 2006 IP
    kk5st likes this.
  4. SOcRatEs

    SOcRatEs Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes got it. Thank you! That was not in my original code on the webpage.
    cut/paste error.
    My ol (http://www.davesite.com/webstation/css/chap07.shtml) conflicted with (http://www.alistapart.com/articles/taminglists/)
    I was missing <div id="button">!

    
    
    
    <style type="text/css">
    body {
    background-image:
    url('images/bg22.jpg');
    background-attachment: fixed;
    }
    OL { list-style: decimal }
    
    OL OL { list-style: lower-alpha }
    
    OL OL OL { list-style: lower-roman } 
    </style>
    <!----Conflicted with---->
    	  <div id="button">
    <ul>
    	<li><a href="index.html">Home</a></li>
    	<li><a href="2.html">Contacts</a></li>
    	<li><a href="3.html">About Us</a></li>
    	<li><a href="http://my-yardsale.com/phpBB2/index.ph">Arizona's Yard Sale</a></li>
    	<li><a href="4.html">Terms of Use</a></li>
    	<li><a href="5.html">Prohibited Items</a></li>
    	<li><a href="6.html">Affiliates</a></li>
    	<li><a href="region.html">Yard Sales by State</li>
    </ul>
    </div>
    <!---end--->
    
    <ol>
        <li>Web Design
          <ol>
            <li>HTML
            <li>CSS
             <ol>
                <li>Intro
                <li>Basics
            </ol>
       </ol>
    </ol>
    
    It looks like this:
    
       1. Web Design
             a. HTML
             b. CSS
                   i. Intro
                   ii. Basics
    
    Code (markup):
     
    SOcRatEs, May 3, 2006 IP