tags:

views:

103

answers:

2

Hi everybody,

I'm trying to make four columns that are centered on the frontpage. I would like it to look like this example:
http://www.clutterpad.com/

My code looks like this:

#bottom-container {width:100%;height:250px;position:relative;}
#bottom-mid {background-color:white;}
#bottom-left, #bottom-mid, #bottom-right {height:250px;}
#bottom-left, #bottom-right {width:50%;float:left;}

#bottom-left {background-color:white;position:absolute;top:0px;left:0px;}
#bottom-right {background-color:white;position:absolute;top:0px;left:50%;}

#bottom-mid {position:relative;margin:0px auto; width:1000px;z-index:2;}
#column-container {width:100%; margin:20px auto;}
.column {width:200px;float:left;font-size:10pt;font-family:Arial;margin:20px 10px;}

But it's not working out. How should I code it to look like the example I mentioned before?

+1  A: 

It would be good if you could include the HTML, but I would approach the problem like this:

<div id="fourcolumns">
    <div>Column</div>
    <div>Column</div>
    <div>Column</div>
    <div>Column</div>
</div>

CSS:

#fourcolumns {
    width: 100%;
    overflow: hidden;
}

#fourcolumns div {
    width: 25%;
    float: left;
}

If you are adding margins between the columns, you will fall victim to the IE6 double margin float bug, which you can fix by including #fourcolumns div { display: inline; }

Finbarr
A: 
<div id="fourcolumns"> 
    <div>Column</div> 
    <div>Column</div> 
    <div>Column</div> 
    <div>Column</div> 
</div> 

CSS:

#fourcolumns { 
    margin: 0 auto;
    width: 50%; 
    overflow: hidden; 
} 

#fourcolumns div { 
    width: 25%; 
    float: left; 
} 
Wayne
Nice. Copy and paste most of my answer.
Finbarr