CSS keep height when image when floating

ReinnaNib

New Member
I have a div that has a photo that has the \[code\]float: left\[/code\] attribute and text is right next to it, like this:\[code\]<div id='1'> <img src='http://stackoverflow.com/questions/14546248/img.jpg' width='50%' style='float:left;' /> This is text next to it<br/><br/>More text</div>\[/code\]I don't know the dimensions of the image, or the height of the text, but the text is often shorter than the image, causing the div to be shorter than the image (which looks really bad). Is there any way I can fix this?
 
Back
Top