- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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
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: https://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.
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!