Forum Moderators: not2easy
Any ideas?
Here's the code (I've added borders so it's easier to see the problem)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css" media="screen">
<!--
#content
{
width: 724px;
padding: 20px;
border: solid 3px #2aace2;
}
.image-container
{
float: left;
width: 100%;
height: auto;
margin: 0;
border: solid 1px #ff7800;
}
.image-left
{
float: left;
margin-right: 10px;
padding: 3px;
border: solid 1px #2aace2;
}
-->
</style>
<title></title>
</head>
<body>
<div id="content">
<div class="image-container">
<img class="image-left" src="images/image2.jpg" alt="" width="160" height="120" border="0"> Mauris quis felis vitae orci tempus pellentesque. Aliquam at eros et mi mollis commodo.
</div>
<div class="image-container">
<img class="image-left" src="images/image2.jpg" alt="" width="160" height="120" border="0"> Mauris quis felis vitae orci tempus pellentesque. Aliquam at eros et mi mollis commodo. Mauris semper erat non eros iaculis vulputate. Nam vitae sapien.
</div>
</div>
</body>
</html>
.image-container
{
width: 100%;
height: 150px;
clear: both;
margin: 0;
border: solid 1px #ff7800;
}
and it seems to have done the trick... sort of. I've had to add a specific height attribute though otherwise the image-container seems to constrain to the amount of text and not the height of the enclosed image?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css" media="screen">
<!--
#content
{
width: 724px;
padding: 20px;
border: solid 3px #2aace2;
}
.image-container
{
float: left;
width: 100%;
height: auto;
margin: 0;
border: solid 1px #ff7800;
}
.image-left
{
float: left;
margin-right: 10px;
padding: 3px;
border: solid 1px #2aace2;
}
.clear
{
clear:both;
}
-->
</style>
<title></title>
</head>
<body>
<div id="content">
<div class="image-container">
<img class="image-left" src="image2.jpg" alt="" width="160" height="120" border="0"> Mauris quis felis vitae orci tempus pellentesque. Aliquam at eros et mi mollis commodo.
</div>
<div class="image-container">
<img class="image-left" src="image2.jpg" alt="" width="160" height="120" border="0"> Mauris quis felis vitae orci tempus pellentesque. Aliquam at eros et mi mollis commodo. Mauris semper erat non eros iaculis vulputate. Nam vitae sapien.
</div>
<div class="clear"></div>
</div>
</body>
</html>