Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in
/kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line
28
Warning: Use of undefined constant text - assumed 'text' (this will throw an Error in a future version of PHP) in
/kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line
29
Warning: Use of undefined constant text - assumed 'text' (this will throw an Error in a future version of PHP) in
/kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line
9
Div Container lassen sich mit absoluter Positionierung und Minusabständen zentrieren (siehe Div Element horizontal und vertikal zentrieren). 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> |
<!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>
Letzte Kommentare