Debugging CSS
Debugging the page for Internet Explorer

The page that we use as an example was posted in a help forum, its author wanted to find why there was a space appearing when hovering the menu with Internet Explorer.

As HTML is valid as well as CSS we can debug the page.

It has been reduced to a test case, the text has been changed and two versions can be displayed here:

The screenshots below show the differences between browsers.

Editing for Internet Explorer 6

The appearing space

The DOM inspector allows us to see that:

hasLayout is set to -1 in #bar.

DOM inspector

hasLayout is absent in #bar ul.

DOM inspector

hasLayout is set to -1 in #bar ul li.

DOM inspector

We enter height:1%; in #bar ul, hasLayout is set to -1 and the space disappears.

DOM inspector

Thus we add height:1%; in #bar ul,preferably between conditional comments, in the HTML:

<!--[if IE]>
<style type="text/css">
#bar ul{height:1%;}
</style>
<![endif]-->

Our final display will be almost the same with recent browsers.