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

Home Forums CSS [Solved] inline-block layout annoyance.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #186045

    I’ve always had a bit of an annoyance with using inline-block to create layouts as demonstrated in the cssdeck snippet below. I’m sure that the absolute positioning shouldn’t be required I just can’t figure out what’s going wrong.

    Pretty much, without content the divs align correctly and fit in their parent container fine, as soon as any content is added it causes the div to drop out of the parent container, however, still containing the content within the parent container (if that makes any sense what so ever)

    See how the actual h3 element stays within the parent container but the rest falls below. If i position the h3 element as absolute this problem is fixed, however, surely there’s a way to do this without absolutely positioning the element?

    I know this isn’t really a big issue, but I just get a little OCD in regards to it…



    It sounds like you need to use vertical-align:top…the default for inline-block items is `baseline…but it’s not entirely clear to me what you are trying to do.

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