Rip's Domain

Note to self: vertical align images in floated list in IE6

Posted in Uncategorized by rip747 on January 6, 2011

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;
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: