Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500

Think I deserve a present? See my Amazon Wish List

CSS centred layer with two columns

In CSS, no tables.

Take one div/layer and centre it. Then have a left hand column and a right hand column. Nice.

See example

DIV.centrebox {
top: 0px;
width: 500px;
height: 100%;
margin-left: -250px;
background-color: #336699;

DIV.leftcol {
position: absolute;
top: 0px;
width: 100px;
height: 100%;
background-color: #cccccc;

DIV.rightcol {
position: absolute;
top: 0px;
left: 100px;
width: 400px;
background-color: #0099ff;

<div class="centrebox">
    <div class="leftcol">
    This is the left column.
    <div class="rightcol">
    This is the right column.

Share this!  

Browsers Sizes | Centre Box Columns | Character Iso-8859-1


  Tips | Home | Search | Contact

Link here: