Forum Moderators: not2easy
Say I have the following HTML:
<div id="container">
<div id="news">stuff</div>
<div id="info">stuff</div>
<div id="more">more stuff</div>
<div id="footer">footer content</div>
</div>
And the following CSS:
/* center the container in IE */
body {
text-align: center;
margin: 0;
}/* center the container for other browsers */
#container {
margin: 0 auto;
width: 800px;
}
#news, #info, #more {
width: 800px;
}
#info, #more {
float:left;
}
$footer {
clear:both;
}
#news {
?
}
What do I need to do to the #news box in order to place it BELOW the other two?
Linearly it occurs (in the HTML) ABOVE the other two - and without a series of buggy absolute positioning hacks, I can't think of a way to get the news box BELOW the other two, but above the footer.
Any ideas?
It's like using
bottom:0;
position:absolute;
for a footer. The footer is placed at the bottom of the viewport - and then STAYS in that spot in the document, like it's glued on top of the page.
Hmmm...
Is this one case where content is in fact not separate from structure?
make that div position:relative, so it flows with content and creates a bounding box (static won't make a bounding box)
Then, make
position:absolute;
bottom: 0;
on the news div. That should make the news div stick to the bottom of the containing div.
[edited by: SethCall at 8:27 pm (utc) on June 25, 2004]