Forums

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

Home Forums CSS Problem with positioning DIVs inside a floating DIV

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #46444
    tuleby
    Participant

    Hi

    I have a couple of floating boxes, and inside each of these I want:

    * an image
    * a H2 heading overlaying the image
    * 2 separate texts positioned under the image

    Also, the height of the box should be automatic, and not fixed. As you see they are resizable down to a certain width.

    I have tried a bunch of different wrappers, floats, positioning etc. for hours, but can’t get it to work.

    Any help would be much appreciated.

    Codepen:
    http://cdpn.io/cCxgf

    Desired result:
    http://tuleby.se/csst.jpg

    Thanks

    #143100
    Paulie_D
    Member

    As I am fond of saying, absolute positioning should be used sparingly, if at all.

    There are much better options for layout.

    Right, let me have a look and see what we have.

    #143101
    jurotek
    Participant

    [Like this?](http://cdpn.io/AKtxF “”)

    #143103
    jurotek
    Participant

    @CrocoDillon, good point, thanx

    #143104
    Paulie_D
    Member

    Here you go. : http://codepen.io/Paulie-D/pen/ckvDz

    Only absolute positioning required is on the h2 tags.

    #143105
    tuleby
    Participant

    Awesome guys, excellent! Thanks a million! Glad to get rid of some absolute positioning. :)

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