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
put it in codepen.io, so we can better help
I'm guessing the container isn't clearing because of all your elements are either floated or positioned. Apply a clearfix to the container, and get rid of the unnecessary positions.
I think he want's the 100% height option. Frankly though there is way to much positioning going on.
The whole thing needs restructuring.
Try to write your code depending less on positioning like @paul_d said.
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?
This might be usefull to watch: http://css-tricks.com/video-screencasts/110-quick-overview-of-css-position-values
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.
Also, you have list items (li) without a wrapping unordered list (ul).
TBH, it's a mess.
Here: http://codepen.io/anon/pen/fqHka
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!
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
put it in codepen.io, so we can better help
I'm guessing the container isn't clearing because of all your elements are either floated or positioned. Apply a clearfix to the container, and get rid of the unnecessary positions.
I think he want's the 100% height option. Frankly though there is way to much positioning going on.
The whole thing needs restructuring.
Try to write your code depending less on positioning like @paul_d said.
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?
This might be usefull to watch: http://css-tricks.com/video-screencasts/110-quick-overview-of-css-position-values
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.
Also, you have list items (li) without a wrapping unordered list (ul).
TBH, it's a mess.
Here: http://codepen.io/anon/pen/fqHka
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!