it seems like absolutly positioned div is affected by layout
Posted: Sat Oct 30, 2004 4:45 pm
i pasted here some ready to use code
just save it as html,run and see the problem and the question
thank you
just save it as html,run and see the problem and the question
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>Strange problem</title>
<style type="text/css">
#leftcol{
position:absolute;left:0px;
width:30px;height:100%;
background-color:#0f0;
}
#middle{
margin-left:35px;
background-color:#00f;
}
#rightcol{
position:absolute;right:0px;
width:30px;height:100%;
background-color:#0f0;
}
#mainbody{
height:300px;width:100%;
position:relative;
background-color:#f00;
}
</style>
</head>
<body>
<div id="mainbody">
<div id="leftcol"></div>
<div id="middle">the greeen div on the right for some reason moves down/up<br /> as i change #middle's height...but it is absolutly positioned!!<br />Do you know what causes it to move??<br />Thank you</div>
<div id="rightcol"></div>
</body>
</html>