Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS IE Inline-block Trouble

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32041
    noahgelman
    Participant

    I have an image wrapped by 2 or 3 divs. The divs are styled in certain ways by the user with buttons. To keep the divs hugging the image, i set them to display:inline-block. That works fine in all browsers except for IE, which is keeping them block elements (they stretch the whole width of the parent).

    Any ideas on how I can get the divs to act like they’re inline-block like they’re supposed to?

    #55329
    noahgelman
    Participant

    Display inline doesnt work, it breaks, and this is affecting IE8 too

    #55344
    noahgelman
    Participant

    I’m not sure you’re understanding the problem.

    I have an image it’s wrapped in a div. The div needs to fit around the image with no spaces. You do that by telling the div to display inline-block. However, IE has a problem changing block elements into inline-block elements.

    The only solution I’ve come up with so far is to switch out the divs with an inline element, like a span, because IE doesn’t have a problem changing inline elements to display inline-block. But that’s actually more work than it sounds for several reasons and I’d like to avoid it if possible. I’m hoping there’s a CSS solution.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.