Forums

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

Home Forums CSS container div won’t expand with content

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #42205
    dizigniz
    Member

    I’ve seen many answers to this on different forums, but still can’t solve it!

    I want my #background to expand with its content but it just won’t. Can anyone help?

    MOD EDIT: Codepen here: http://codepen.io/anon/pen/FKfAk

    #122117
    Paulie_D
    Member

    I think he want’s the 100% height option. Frankly though there is way to much positioning going on.

    The whole thing needs restructuring.

    #122121
    S_Honderdos
    Member

    Try to write your code depending less on positioning like @paul_d said.

    #122129
    dizigniz
    Member

    Thanks everyone.
    I’ve tried the clearfix and 100% height.
    Is it too many nested divs?
    How can I position my elements without these divs?

    #122136
    S_Honderdos
    Member
    #122140
    Paulie_D
    Member

    What we are saying is that using positioning is not recommended UNLESS you are trying to make a specific effect.

    Using it on everything instead of properly organising and structuring your HTML & CSS is just bad practice.

    I (and I think most here) would highly recommend brushing up on floats and how they work.

    #122141
    Paulie_D
    Member

    Also, you have list items (li) without a wrapping unordered list (ul).

    TBH, it’s a mess.

    Here: http://codepen.io/anon/pen/fqHka

    #122149
    dizigniz
    Member

    Thanks all. Good video @S_Honderdos . And thatks @Paulie_D for the clearer code – I realise now that positioning is not the solution to everything!

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