z.B. so gehts (
Quelle):
HTML-Code:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
font: 100%/1.6 sans-serif;
color: #fff;
}
.test {
font-size: 3em;
background: #4d4d4d;
margin: 300px 0 0 170px;
width: 250px;
height: 140px;
}
.test p {
text-align: center;
position: relative;
top: 50%;
transform: translateY(-50%);
}
</style>
</head>
<body>
<div class="test">
<p>Test</p>
</div>
</body>
</html>