CSS “display: inline-block” in IE7

2009 February 27
by cathy

The CSS property “display: inline-block” only works in IE7 when it is applied to selectors that are displayed natively inline. For example, if you have an <h tag that needs to display as an inline-block you need to wrap the text with a span. This should be done with the span inside the h tag; i.e.

<h1><span class=”ie-block”>My Inline Headline</span></h1>

Because valid XHTML doesn’t allow native block elements to reside inside native inline elements, no matter how you apply your CSS properties.

This is all over the Internet in various forms. There are many more complicated examples of using inline-blocks in IE. Just thought I’d post this simple note about it.

3 Comments leave one →
2009 May 6
Niels permalink

Thanks, saves me some reading large posts

2009 August 26
Rick permalink

Awesome! Short and to the point. Thanks!

2010 February 16

Agree with the previous comment. Thanks!

Leave A Comment

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS