
Originally Posted by
SgtLegend
On your LI element all you simply need to do is add a width but you will need to change the display property to inline-block as you can't use height and width on inline elements:
Code CSS:
#navigation li{
display: inline-block;
*display: inline; /* IE6+7 Fix */
width: 100px;
}
Hi Chris,
Forgive the small correction but the IE6/7 fix cannot be in the same rule as it won't work.
It needs to be exactly like this:
Code:
#navigation li{
display: inline-block;
width: 100px;
}
#navigation li{*display: inline; /* IE6+7 Fix */}
If you place the display:inline in the same rules as the display:inline-block then the element never gets haslayout because the display:inline-block is ignored and only display:inline is seen.
If you separate the rule as above then what happens is that IE6/7 see the display:inline-block and apply haslayout to the element (this is probably the only real use of display:inline-block). In the next rule you set the element to display:inline and in IE6/7 an inline element that is in haslayout mode behaves just like inline-block (this is probably a throwback to ie5 which allowed dimensions on inline elements by default).
The display:inline-block is a haslayout trigger for both inline and block elements which is why you can't use some of the other haslayout triggers. zoom:1.0 is also a haslayout trigger for both inline and block elements and you can can actually create an inline-block element in IE6/7 without using inline-block. All you do is make the element inline and apply haslayout suitable for an inline element.
Code:
p{display: inline;zoom:1.0 /* IE6+7 Fix */}
Bookmarks