![]() |
two columns?
How do I make two columns (not a two column layout, just two columns)?
I tried like... everything, and It won't work without tables. If you add info on the left it pushes the right part down.. |
Your going to want to look into the CSS Float property: CSS Float Property
|
As hostfreak says, use the float property. Here's a simple mock-up:
html4strict Code:
|
I would also suggest putting this:
Code:
* { |
Yea. Well pointed out, Andrew. I always add that at the top and it really does save a lot of the time. It's predominantly due to that Firefox, IE, Opera, et cetera... all stupidly set their very own margin and padding for various elements, and thus resetting all the values allows you to build from the ground up.
|
I have a reset.css file that resets EVERYTHING to a shared medium. This also helps guard against people toying with default values >.>
Anyway.. How does that work if it is both float:left; ? |
If the sum of the divs widths is less than the full width of the space available they both float to the left and bump into each other, so to speak, and end up sitting next to each other. If you don't float them both, one drops below the other. Dropping below the other can also happen if you add borders and margins and padding and the sum of their total width exceeds the total space available. you can also get this if you use percentages as widths and rounding off errors take you over the 100% mark, so I often make the percentages add up to 95% instead.
|
A clear is always required after floating elements. Otherwise, you risk your sanity because everything flows around:
html4strict Code:
|
| All times are GMT. The time now is 06:14 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0