jo-da:
sådan kan du centrere horisontalt; men skal det også være verticalt?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
<title>CSS Centering</title>
<style type="text/css" media="screen">
body {margin:0px; padding:0px;}
#indhold {
position:absolute;
left:50%;
width:500px;
margin-top:50px;
margin-left:-266px;
text-align:left;
padding:15px;
border:1px dashed #333333;
background-color:#eeeeee;
}
</style>
</head>
<body>
<div id="indhold">
<h1>Centering: Negativ margin</h1>
<p>Denne boks centreres med: "position:absolute; left:50%;". Så bliver boksens venstre margin sat til det modsatte med: "margin-left:-266px;".</p>
<pre>
body {margin:0px; padding:0px;}
#indhold {
position:absolute;
left:50%;
width:500px;
margin-top:50px;
margin-left:-266px;
padding:15px;
border:1px dashed #333;
background-color:#eee;
}
</pre>
</div>
</body>
</html>