Forum Moderators: not2easy
<!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" lang="en">
<head>
<title>test</title>
</head>
<body>
<div id="main" style="width:950px">
<div id="left" style="width:170px;height:300px;float:left;position:absolute;background-color:grey;"></div>
<div id="middle" style="width:500px;height:300px;float:left;position:absolute;background-color:blue;margin-left:175px;"></div>
<div id="right" style="width:170px;height:300px;float:left;position:absolute;background-color:grey;margin:0px auto 0 680px;"></div>
</div>
</body>
<div id="bugger" style="margin-left:auto; margin-right:auto; clear:both; width: 570px; margin-top:30px; height:30px; background-color:black;"></div>
</html>
1) Hard code the absolute position the bugger div below the first 3 but I'll assume the size of the first 3 divs is dynamic so that won't work.
2) If you can/want to use javascript, you could use an onload function to get the position and size of the first three divs and then position the bugger div with that info. I can reply again with that code if you need it.
AgentAlpha, I'd love to see the javascript necessary to determine the height of the entire page onload. I can't do it based on the three divs or the "main" div because their id's won't always be the same based on the applications I'm looking at.
Some other things:
You have some elements set to both float:left and position:absolute. This should not be done. If you want them to be floated, and have them be containing blocks, then set position:relative on them, not position:absolute!
Currently, according to current standards, your code will ignore the float, and try to position absolutely. Thing is, you also don't have any coordinates, so it will use auto positioning (so you probably don't notice what it's doing)
[w3.org...]
[w3.org...]
[edited by: Xapti at 11:45 pm (utc) on Sep. 19, 2007]