Div Container lassen sich mit absoluter Positionierung und Minusabständen zentrieren (siehe [post id=3140][/post]). Meine neue Lieblingsmethode, um einen Div Container mittig zu platzieren, ist aber Folgende:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<style>
#wrapper {
width: 400px;
height: 400px;
position: relative;
display: table-cell;
vertical-align: middle;
text-align: center;
background-color: black;
}
#center {
width: 200px;
height: 200px;
position: relative;
display: inline-block;
background-color: yellow;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="center"></div>
</div>
</body>
</html> |