gamerff
Goto Top

Webseite zentrieren

Hallo,

ich habe eine webseite erstellt und möchte nun das diese seite bei jeder Bildschirmgröße immer in der mitte angezeigt wird.
Wie kann ich das machen ?

Content-Key: 241447

Url: https://administrator.de/contentid/241447

Printed on: April 19, 2024 at 08:04 o'clock

Member: napperman
Solution napperman Jun 20, 2014 updated at 08:54:53 (UTC)
Goto Top
Member: colinardo
Solution colinardo Jun 20, 2014 updated at 10:24:47 (UTC)
Goto Top
wenn das ganze "Responsive" sein soll z.B. so vertikal und horizontal zentriert:
Beispiel
<!doctype html>
<html>
<head>
<meta charset="utf-8">  
<title>DIV horizontal und vertikal zentrieren (responsive)</title>
<style type="text/css">  
#centered {
	position:absolute;
	background-color: #0CF;
	height: 80vh;
	width: 80vw;
	left:50%;
	top:50%;
	margin:-40vh 0 0 -40vw;
}
#centered table td {
	text-align:center;
	vertical-align:middle;
	font-size: 15vh;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:bold;
	color:white;
}
</style>
</head>

<body>
<div id="centered">  
<table width="100%" height="100%">  
<tr><td>WEBSITE</td></tr>
</table>
</div>
</body>
</html>
Grüße Uwe