Skip to content

Inline Block Hack for IE 7 to Allow Centered Layout of Child Block Elements

by on March 26, 2012

This works for Div’s, or anything else you want to center within another block element.

.mystyle{

    text-align: center;

}

.mystyle li{

    display:inline-block;*display:inline;zoom:1;

}

Zoom forces IE to recognize the style and display the content inline, so you can add text-align to the parent element and the child elements will respond in IE 7. IE 8+ follow inline-block css rules by default.

Advertisements

From → CSS, Web Design

Leave a Comment

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: