Mark Smith

ASP.NET, SQL Server, HTML, CSS and other random thoughts!

IE7 Bug

Today I found a strange bug in IE7. If you have an unordered list, and you specifically give a height to each li element, the numbers reset themselves so each number ends up being "1"! Try this out!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">  <head>    <title>Test</title>    <style type="text/css">     ol li {height:40px;}    </style>  </head>  <body>    <ol>      <li>This</li>      <li>is</li>      <li>just</li>      <li>a</li>      <li>test</li>    </ol>  </body>

</html>

 

Comments

rajbk said:

Use this as a work around

ol li {

  display:list-item;

  height:40px;

}

Regards,

Raj Kaimal

# January 11, 2008 3:11 PM

Mark Smith said:

Thanks Raj,

I'd actually used a workaround of using line-height instead of height.

My problem with it, is that it's a bug that shouldn't exist (it happens in IE6 as well).

# January 12, 2008 2:27 PM

Paul said:

Same problem when you set the width of a LI, but the Raj's hack fixes that as well.

Paul

# January 25, 2008 12:14 PM

Curioso bug en Internet Explorer 7 | aNieto2K said:

Pingback from  Curioso bug en Internet Explorer 7 | aNieto2K

# June 30, 2008 9:17 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)