Skip to content

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 because valid XHTML doesn’t allow native block elements to reside inside native inline elements; e.g.

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

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 Responses leave one →
  1. Niels permalink
    May 6, 2009

    Thanks, saves me some reading large posts

  2. Rick permalink
    August 26, 2009

    Awesome! Short and to the point. Thanks!

  3. February 16, 2010

    Agree with the previous comment. Thanks!

Leave a Reply

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

Subscribe to this comment feed via RSS