Page 1 of 1

it seems like absolutly positioned div is affected by layout

Posted: Sat Oct 30, 2004 4:45 pm
by newmember
i pasted here some ready to use code
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&#123;
position:absolute;left:0px;
width:30px;height:100%;
background-color:#0f0;
&#125;

#middle&#123;
margin-left:35px;
background-color:#00f;
&#125;

#rightcol&#123;
position:absolute;right:0px;
width:30px;height:100%;
background-color:#0f0;
&#125;

#mainbody&#123;
height:300px;width:100%;
position:relative;
background-color:#f00;
&#125;
</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>
thank you

Posted: Sat Oct 30, 2004 4:58 pm
by Weirdan
add top:0px to the styles of the left and right columns.

Posted: Sat Oct 30, 2004 5:48 pm
by newmember
thanks a l :D t...
(such a stupid err :oops: r)