rjonk
08-29-2005, 02:03 PM
I have a floating image inside a layer.
<div class="blockimage"><img src="/images/myimage.jpg" class="fleft"/></div>
When I have no scrollbar in the window for firefox and don't resize the window I get a whitespace gap under the image.
I haven't seen the sollution on internet so I tried to figure this out myself;
the sollution: for the containing div set the style for display to table
for the image set the display style to table-cell
example
.blockimage {display:table;border:1px solid #f00}
.blockimage image.fleft {display:table-cell;float:left;width:125px;height:100px;}
<div class="blockimage"><img src="/images/myimage.jpg" class="fleft"/></div>
When I have no scrollbar in the window for firefox and don't resize the window I get a whitespace gap under the image.
I haven't seen the sollution on internet so I tried to figure this out myself;
the sollution: for the containing div set the style for display to table
for the image set the display style to table-cell
example
.blockimage {display:table;border:1px solid #f00}
.blockimage image.fleft {display:table-cell;float:left;width:125px;height:100px;}