At the moment, I have two div tags which are set to “float:left;” I want to apply a background colour to both but each can vary in size dependent on the contents.
I have tried adding an extra div and just applying a background colour to it but there is no height?
Here is my test page: http://joshblease.co.uk/wp-content/themes/rounded/test.php
Thanks, Josh.
Oh I see. You want the background to be a box around the extremes of the floated divs?
Parent divs by default do not expand to contain floated children. There are a few workarounds to this:
overflow: hiddenoroverflow: auto.#back), and set it toclear: both.Any of those should work for you.