hey guys, how can I just achieve this simple layout? I'm hoping the answer will help me understand the basics of css layout and floats.
<div id="verticalElement1">
<div id="horizontalElement1">
some content
</div>
<div id="horizontalElement2">
some content
</div>
<div>
<div id="verticalElement2">
<div id="verticalElement3">
some content
</div>
<div id="verticalElement4">
some content
</div>
<div>
Ok, so, as the "id"s suggest, I'd like the vertical elements to sit one on top of each other.
inside the top element, I'd like the 2 horizontal elements to sit next to each other.
I want to achieve this without applying "inline" to any elements.
Also, I don't want to use absolute positioning, unless its relative to some element, and scales nicely.
I'd like to achieve all this with very clean and scalable CSS, in such a way that i can add and remove elements, without having to change style values. Everything should be done by just applying the appropriate classes to certain elements, something like this:
<div id="verticalElement1" class="containsHorizontalElements">
<div id="horizontalElement1" class="isHorizontal">
some content
</div>
<div id="horizontalElement2" class="isHorizontal">
some content
</div>
<div>
<div id="verticalElement2">
<div id="verticalElement3">
some content
</div>
<div id="verticalElement4">
some content
</div>
<div>
I've tried applying floats but everything goes crazy....help!
cheers