gamerff

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 ?
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 241447

Url: https://administrator.de/forum/webseite-zentrieren-241447.html

Ausgedruckt am: 25.04.2025 um 14:04 Uhr

napperman
Lösung napperman 20.06.2014 aktualisiert um 10:54:53 Uhr
Goto Top
colinardo
Lösung colinardo 20.06.2014 aktualisiert um 12:24:47 Uhr
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