Hi. I have stripped out most of the code from my page, and left in the essentials to demonstrate my problem.
[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en-gb” lang=”en-gb” >
<head>
<style type=”text/css” media=”screen”>
div#leftPanel {
float:left;
width:200px;
height:100px;
background:yellow;
}
div#mainPanel {
margin-left:250px;
background:red;
}
div#innerPanel {
background:green;
width:200px;
height:50px;
float:left;
}
</style>
</head>
<body>
<div id=”leftPanel”></div>
<div id=”mainPanel”>
<div id=”innerPanel”></div>
<div style=”clear:both”></div>
Here is some more text
</div>
</body>
</html>
The clear:both style in the inner div is pushing the subsequent text to below the height of the left panel. If i remove the doctype, the problem goes away, but obviously i don’t want be doing that.
I found it a bit difficult to explain in words, so i attach an image of how it should look and how it does look.
Can anyone help me out?
[upl-file uuid=defefbd9-69d1-42b3-a07e-a302d83c5ca6 size=6kB]demo.gif