Some of you may have seen my last thread, and now that I have gotten into the stage of actually writing the html and css, I feel like a little kid needing guidance. So far, it has all been going pretty well, have managed to ‘do’ a large part of the frontpage, though I am struggling on the CSS Positioning elements and in particular for my columns.
In my design, I have made the columns like this:
So 2 columns on the top and 3 at the bottom.
I have done some research, and found a site which gave me the impression that in my case it would be best to divide first into the top and bottom columns, and then placing the divs of the columns into the ones before. So for example, the div of the ‘Arrangementen’ would be place into the one of ‘Accommodaties’. In this way, I should be able to place the columns relative to the other one.
I tried to do this, but I can’t seem to find how to put the columns on the same line. My current html is like this (for the top 2 divs):
<div id="columns-top">
<div id="column1">
<img src="http://www.sitepoint.com/forums/images/accommodaties.jpg" >
<h2>Accommodaties</h2>
<p>Lorem ipsum text.</p>
<a href="#" class="leesverder">Meer over accommodaties</a>
<div id="column2">
<img src="http://www.sitepoint.com/forums/images/arrangementen.jpg" >
<h2>Arrangementen</h2>
<p>Lorem Ipsum text</p>
<a href="#" class="leesverder">Meer over arrangementen</a>
</div>
</div>
And my current css is like this:
#columns-top {}
#column1 {
position: relative;
width: 449px;}
#column2 {
position: relative;
left: 530px;
width: 449px;}
This is the result:
Another option:
Though, I also think it should be a possibility to align them left and right, and for the bottom 3 to allign left, center and right. Though, I’m not sure how to do this (using float?) and I’m also not sure whether this is a better option to do.
So basically I have 2 questions:
- How do I put the columns on the same line?
- Is my first option the best choice, the other option or is there maybe another one that I didn’t think of?