Possible Duplicate:
Stacking Divs with CSS
Im kinda new to CSS have been using tables for my html for years, Im trying to figure out how I can nest divs or stack them inside the content section of a 3 column layout. with tables I'd just do a new TR but if I float another div into the content line line it will appear parallel or vertically to content, instead of under it. is there another way to do this or am I missing the point of Div开发者_Python百科s here?
<div id="header">Header</div>
<div id="leftcolumn">Left Column</div>
<div id="content">Content</div>
<div id="footer">Footer</div>
If you nest something inside #content
and apply clear:both
to it then it will appear beneath the content in #content
.
See the following articles from the Opera Web Standards Curriculum:
- Floats and clearing
- CSS Static and relative positioning
- CSS Absolute and fixed positioning
To have a floated element appear under another floated element, set clear: both;
on that element.
You might be better asking this on http://doctype.com/.
You need to clear your floats by using the {clear:left} rule or simply remove the floats. Read up on the the difference between inline and block elements and how you can manipulate them using the display property.
精彩评论