tags:

views:

5225

answers:

6
+1  A: 
display:inline  
float:left

is your problem

Floating makes the parents width not be stretched by the child, try placing the image without the float. If you take the float off, it should give you the desired effect.
Another approach would be to make sure you are clearing your floats at the end of the parent element so that they don't scope creep.

Update: After viewing your link Your height issue as displayed, is because the floats are not being cleared.

DevelopingChris
+4  A: 

In the markup after the image, insert something like <div style="clear:left"/>. A bit messy, but it's the easiest way I've found.

And while you're at it, put a bit of margin on that image so the text doesn't butt up against it.

John Millikin
+3  A: 

Assuming @John Millikin is correct, the code

.product + * { clear: left; }

would suffice to do the same thing without forcing you to manually adjust the code after the div.

Domenic
+7  A: 

Add overflow:auto; to .product1

John Sheehan
+2  A: 

One trick you can use is to set the <div>'s overflow property to hidden. This forces browsers to calculate the physical size of the box, and fixes the weird overlap problem with the floated image. It will save you from adding in any extra HTML markup.

Here's how the class should look:

.product1 {
    width: 100%;
    padding: 5px;
    margin: 0px 0px 15px -5px;
    background: #ADA19A;
    color: #000000;
    min-height: 100px;
    overflow: hidden;
}
Jeremy Kratz
+1  A: 

This looks like a job for clearfix to me ...

David Heggie