Hi
I have a div element containing an image and some text.
The image is floated to the left of the text, but is somewhat higher than the text.
For some reason the div (i noticed by the background color) finishes right after the text, inline with the text, and continues inline with the image until It ends.
This causes a sort of stepped appearance of the div’s background color.
Why does this happen?
Here are the code parts:
HTML:
[CODE]
<div class=”container” id=”divPack”>
<h5>GIFT PACKAGING</h5>
<img class=”img2″ src=”someimage.jpg” />
<p>Some Text</p>
</div>
CSS:
[CODE]
.container {
width:660px;
margin:0px;
background-color:#d0c5ac;
margin-top:20px;
padding:10px;
padding-top:20px;
overflow:visible;
visibility:visible;
z-index:3;
}
.img2 {float:left; margin:8px; margin-bottom:20px}