Forums

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

Home Forums CSS Make parent element expand vertically as much as its inner absolute element.

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #144960
    NOjAN
    Participant

    I think the question needs no extra explanation. But here’s a pen to demonstrate it better:
    http://codepen.io/nOji/pen/pgwlm

    Any ideas?

    #144961
    Paulie_D
    Member

    Pretty sure this isn’t going to have a CSS solution.

    As I am sure you are aware, absolutely positioned elements are removed from the document flow and thus heights are ignored by ‘parent’ elements.

    JS/JQ would be the simplest way forward.

    #144963
    NOjAN
    Participant

    Thanks Paulie. Kinda wanted to make sure, because we always find new techniques and hacks that we used to think aren’t possible with pure css. (i.e. centering in the unknown)

    #144976
    Kitty Giraudel
    Participant

    Problem here is you can’t even use a pseudo-element of your child element to fake an inline element in the parent since it has already been moved out of the flow.

    I can’t see any CSS solution for this.

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