Page is a not externally linkable
encyclo - 7:55 pm on Mar 2, 2005 (gmt 0)
Here's my test page, for anyone interested: I don't have Opera 7.54 so I can't test it in that, but it might work there too - same goes for Safari (but that's less certain).
Nice find, Suzy. I've been looking at this a bit: you can make IE behave if you use the underscore hack to give a height of 1%, but that's an ugly hack. However, overflow:auto; seems to work OK in Opera 8 beta 1 as well, even if as you say overflow is wobbly in Gecko in a more complex layout. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>testing floats and overflow</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
div {
border:1px dashed red; /* just to show div positions */
}
div#test {
background:#ffc;
overflow:auto; /* for Gecko and Opera 8 */
_height:1%; /* for IE */
}
div#floattest {
width:200px;
float:left;
}
</style>
</head>
<body>
<div id="test">
<div id="floattest">
<p>text floated left, should have yellow background only when overflow is set to auto</p>
</div> <!-- close floattest div -->
<p>more text in the non-floated div, yellow background all the time</p>
</div> <!-- close test div -->
</body>
</html>