Oli said:
Hello.
I'm creating a DIV to hold a short article and an associated image, and
I want the image on the left.
See
http://olifilth.co.uk/test4.htm for an example.
However, with this set-up (as you can see in the example if your browser
window is wide enough), the containing DIV only stretches down as far as
the end of the text, not the end of the image.
How would one do this properly, so that the DIV graphically contains
everything, regardless of whether the image or the text is "higher",
using proper CSS layout rather than tables?
TIA,
Oli
One week and no one knows, huh?
It's possible, but what price you have to pay and how many tricks you
have to do to make it happening?
When everything fails, use faithful tables.
Works perfectly in every browser and validates.
You can do magic with tables and a moderate use of css.
The mix is the answer for FAST, efficient and cross browsing compatible
web design.
Time is money! Pure css is a waste a *lot* of time.
The best css' pure pages are...css soup, multiply css's with hacks for
compatibilities.
KISS...
BTW. Of course you can further use css to make that table... ummm...
more modern, but... again...
KISS
-------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<style>
<!--
p {margin: 12px;}
img#bad {float: left; padding: 12px;}
-->
</style>
</head>
<body>
<div align="center">
<table border="0" width="70%" cellspacing="1" cellpadding="0"
bgcolor="#C0C0C0">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="left"> <p align="center">
<img id="bad" src="smile.gif" width="256" height="266"alt="pic">
Lorem
ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.Lorem
ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.Lorem
ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.</p>
</td>
</tr>
</table>
</div>
</body>
</html>