Marc Schwarz: Div mit Position: absolute zentrieren

Beitrag lesen

hmm, habs glaube ich selbst raus, wäre diese Lösung besser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
<style type="text/css">
<!--
body {
 margin: 0px;
 padding: 0px;
}
#container {
 margin: auto;
 width: 400px;
}
#test {
 position: absolute;
 width: 400px;;
 top: 10px;
 z-index: 1;
}
#test2 {
 position: absolute;
 width: 400px;
 top: 355px;
 z-index: 2;
}
-->
</style>
</head>
<body>
<div id="container">
  <div id="test2">OBERER DIV CONTAINER</div>
  <div id="test"><img src="flames.jpg" alt="" width="400" height="335"></div>
</div>
</body>
</html>