...

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



docock
07-18-2011, 12: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">
<head>

<title></title>
</head>
<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>
<div style="clear: both;"></div>
<div style="width: 896px; min-height: 600px; background: purple;">lol</div>

</div>
</body>
</html>

Sammy12
07-18-2011, 02: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; }




<body>
<div class="inner">

</div>
</body>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum