Bugs with nested lists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • limweizhong
    New Member
    • Dec 2006
    • 62

    Bugs with nested lists

    I would like to know why the following code appears very different in many browsers (IE 6.00, Opera 9.27, Firefox 2.0, etc.) -- at least the browsers that I have.

    Thanks.

    Code:
    <html>
    <body>
    <ol>
    <li style='border:1px solid #f00;'>
    	<ol type='a'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    <ol>
    <li style='border:1px solid #0f0;'>
    	<ol type='a' style='height:50px;'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    <ol>
    <li style='border:1px solid #00f;'>
    	<ol type='a' style='float:left;'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    <ol>
    <li style='border:1px solid #0dd;'>li1
    	<ol type='a'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    <ol>
    <li style='border:1px solid #d0d;'>li1
    	<ol type='a' style='height:50px;'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    <ol>
    <li style='border:1px solid #fd0;'>li1
    	<ol type='a' style='float:left;'>
    	<li>li2</li>
    	</ol>
    </li>
    </ol>
    </body>
    </html>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    You aren't using a doctype. Without one, you are in quirks mode and, IE in particular, will give you more fits than it already does. Put this on your first line:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    "type" is not an attribute of <ol> either.

    Make sure you are not using IE as your reference browser.

    Comment

    • limweizhong
      New Member
      • Dec 2006
      • 62

      #3
      1. A strict doctype has very little positive effect on the layout (at least in IE)
      2. 'type' is an attribute of <ol>, just deprecated (so not in the strict doctype).
      3. I was also wondering why in some browsers shuffling the <ol>s around makes a difference to the rendering.

      Comment

      Working...