View Full Version : Can't seem to center the columns

07-18-2011, 01:23 AM
I've got this coding which produces two columns next to each other in the top. And one columns below that.

I've tried several things to get all columns centered in the middle, without succes :S

Who can help me out?

<html xmlns="http://www.w3.org/1999/xhtml">

<body style="margin: 0 auto;">
<div style="text-align: center;">
<div style="position: relative; top:30px; width:896px; height: 196px; background: orange;">
<div style="float:left; width: 196px;height: 196px; background: lime;">links</div>
<div style="float:right; width: 700px;height: 196px; background: green;">rechts</div>
<div style="clear: both;"></div>
<div style="width: 896px; min-height: 600px; background: purple;">lol</div>


07-18-2011, 03:01 AM
you have to set a width to the body.

you probably want to set it to a tag other than the body.

.inner { width: 960px; margin: auto; }

<div class="inner">