View Full Version : Resolved How do I get my CSS color background to extend with image?

12-09-2010, 08:19 PM
How can I make my background color for a specific class extend to the height of a containing image instead of stopping with the text? I'm trying to add images to the left of my news boxes as seen HERE (http://www.cineweekly.com/test/test.php). As you can see on the news boxes with grey backgrounds (or when hovered over) the background doesn't cover the image. I padded and added margins to the image but it didn't extend the color.

I'm sure this is amateur stuff but I can't seem to figure it out. Thanks.

12-09-2010, 08:31 PM
Hello cineweekly.com,
You need to clear your floats. Have a look at this page on how to clear floats (http://www.quirksmode.org/css/clearing.html) using overflow: auto;

Like this -
a p.newsA {
background-color: #E0E0E0;
color: #000;
padding: 0px 8px 0px 8px;
overflow: auto;

12-09-2010, 08:37 PM
Awesome thank you so much. I haven't came across overflow until now so it would have been a while until I found it.