Jovica Bozinoski
Jovica Bozinoski

Reputation: 1

Float element inside div

I want to make a DIV that holds product information. In the DIV, the product description needs to wrap around the product image. I am using align="left" for the image.

My problem is when there is only 1 line of product description, the DIV's height is only 1 line, leaving the image expanding downwards outside of the DIV border in Firefox 1.5. (IE expands the DIV to include the images)

a

Upvotes: 0

Views: 547

Answers (3)

eh9
eh9

Reputation: 7430

Without seeing the code, it's hard to tell, but it sounds like you should be using float:left rather than align:left for the style of the image. Also, the div element should ordinarily expand to fit a contained the image, so I imagine there's some extra styling there to look at.

Upvotes: 0

Andy
Andy

Reputation: 84

It sounds like you need to clear the contents of you DIV. An additional DIV element with clear:both, just inside the end of the container would do it. Or you can use a CSS clearfix http://www.webtoolkit.info/css-clearfix.html

Upvotes: 0

Marko Francekovic
Marko Francekovic

Reputation: 1490

Try adding this to your div

overflow: hidden;

Hope it helps.

Upvotes: 2

Related Questions