Reputation: 1981
Here is the code:
<div style="border-style:solid; border-color:aqua; border-width:1px;">
<img src="some picture" align="left" />
<div>
<span >SOME TEXT</span></br>
<span >SOME TEXT</span></br>
<span >SOME TEXT</span>
</div>
</div>
The span block takes less (vertical) space then image and so the border and image overlaps and the image is partly out of the div span. Here is jsFiddle
How to apply border to out div?
Upvotes: 0
Views: 12406
Reputation:
if this http://jsfiddle.net/vleran/aTDYL/8/ is what you are trying to do than just add <div style="clear:both;"></div>
before closing tag of the outer div (the parent div).
Upvotes: 2
Reputation: 6607
You should clear the image and the div with spans adding : <div style="clear:both"></div>
in the end.
<div style="border-style:solid; border-color:aqua; border-width:3px;">
<img id="image_HDDimageControl" src="http://stereo-ssc.nascom.nasa.gov/beacon/t0193.jpg" align="left">
<div>
<span >SOME TEXT</span ></br>
<span >SOME TEXT</span ></br>
<span >SOME TEXT</span >
</div>
<div style="clear:both"></div>
Upvotes: 3