To achieve the desired layout, my suggestion is to place two DIVs inside another DIV that has a position set to absolute. By doing this, you ensure that the two inner DIVs do not interfere with each other when both have an absolute positioning. Here's a simple example:
<div id="wrapper">
<div id="content">
Content...
</div>
<div id="bottom">
Bottom..
</div>
</div>
Here's how you can style it using CSS:
#wrapper
{
position:absolute;
top: 110px;
left: -400px;
width:800px;
}
#bottom
{
border-top: 2px dotted #2259FF;
font-family: ebrima;
padding-top: 5px;
height: 200px;
margin-left: 50%;
background-color:green;
}
#content
{
padding: 0px;
margin-left: 50%;
min-height:400px;
_height:400px;
background-color:yellow;
}
In this setup, I enclosed the two inner DIVs within a parent DIV (wrapper) that has an absolute position, similar to your requirements for the positioning of the two DIVs. By not setting absolute position on the inner DIVs, the first will naturally push the second as its content expands. You can also set a minimum height for the first DIV by using min-height:400px
, but be cautious as Internet Explorer may have issues with min-height
. To address this in IE, add _height:400px;
since IE interprets height
as min-height
. Other browsers won't be affected by _height
, ensuring compatibility.