Forums

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

Home Forums CSS How to grow a conatainer div, when content is moving

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #240352
    zantafio
    Participant

    Hello,
    i’d like to create a div container for a project, which contains an image and some captions. the captions are hidden behind the image and get “drawn” out the bottom on click / touch.
    It works fine, however the container is not growing in size and the adjacent ones dont move their position, so the caption-drawer is not visible.
    Here is a pen ( for better clarity i put the drawer on top of the image here )
    http://codepen.io/zantafio/pen/bpYzLg

    any ideas greatly appreciated.

    #240362
    Anonymous
    Inactive

    Hello,
    I really do not know, maybe something like

    height: auto;

    Maybe that will work…

    Thanks.

    #240368
    Paulie_D
    Member

    If you want adjacent elements to move you can’t use absolute positioning. I’d start there.

    #240451
    zantafio
    Participant

    Hm, but how can i stack the one div under the other one without using absolute positioning?

    #240455
    bearhead
    Participant

    Something like this maybe?

    http://codepen.io/kvana/pen/oxEqQj

    #240464
    zantafio
    Participant

    Thanks a lot that does solve the growing.
    However: The overlay cant have a fixed height since the text inside will be dynamic.
    Maybe i do need to use Javascript?

    #240479
    bearhead
    Participant

    yeah, if you’re already using jquery, this can be made much easier just using the slideToggle method:

    http://codepen.io/kvana/pen/oxEqQj

    #240557
    zantafio
    Participant

    thanks a lot bearhead!
    however there is one extra thing i was aiming for:
    hardware acceleration. this is why I wanted to use translate3d …
    any idea on that?

    #240558
    Beverleyh
    Participant
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.