resizing DIV to an aligned image

liunx

Guest
for some reason you cant have a DIV automatically resize when you insert a picture aligned to the left (or other) with text around it, the image overlaps the border of the DIV, wondered if you have encountered this problem and how to fix it.<br />
<br />
thanks for your time.<br />
<br />
KJ<!--content-->Are you setting the position realm of the div (e.g. position: absolute) etc ? You can set the width of an element with no positioning set to a percentage of the sourrounding element, but often it is enough to state: align=left for example. You can also try float.<br />
<br />
<table border=2 width=500><br />
<tr><br />
<td><br />
<img src=http://www.htmlforums.com/archive/index.php/"flowers.gif" width=200 height=100><br />
<div id='autofit' style="float: right"><br />
</td><br />
</tr><br />
</table><!--content-->thanks for the reply, i'll try it and let you know<br />
:)<!--content-->
 
Back
Top