Hi, ihr Positionierer
Allerdings habe ich - trotz anders lautender Postings hier im Forum - noch keine Seite gesehen die das valide hinbekommen hat.
Das hat doch glatt meinen Spieltrieb angeregt. Es war gar nicht so schwer ;-)
Von CSS oder gar Netscape 4.x ganz zu schweigen.
Valides XHTML + CSS, das Urgestein vergessen wir lieber schnell.
Ich freue mich aber auf "Gegenbeweise" ;-)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
<title>Zentriertes DIV</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
<!--
#boxa {
position:absolute;
top:50%;
left:50%;
width:20px;
height:20px;
border:1px dotted red; /* zur Demonstration */
}
#boxb {
position:relative;
top:-150px;
left:-200px;
height:300px;
width:400px;
border:3px solid green;
}
-->
</style>
</head>
<body>
<div id="boxa">
<div id="boxb">
<!-- Inhalt -->
<p>#boxb</p>
</div>
</div>
</body>
</html>
Für ganz Faule: http://www.skop.net/self/zentriertes_div.html
LG Orlando