Note to self: vertical align images in floated list in IE6
I’m constantly forgetting this, though hopefully i won’t need this after this year
In order to get IE6 to respect vertical-align:middle on floated list element, use the underscore hack to add a font-size with the same pixel value as the line height.
NOTE: in this example the images are 60px height.
li {
float: left;
margin-right: 5px;
line-height: 60px;
_font-size:60px;
}
li img {
vertical-align:middle;
}
Advertisement
leave a comment