Hallo,
ich habe für meine Website folgende Programmierung als Ausgangspunkt genommen. Nun bin ich mit meiner Website schon mitten in der Arbeit, jedoch ist mir nun aufgefallen, dass dieser Code zwar zentriert, jedoch im Zweifelsfalle links oben am Null-Punkt meine Seite auch abschneidet, wenn das Fenster zu klein ist. Ich finde das äußerst ungünstig, weiss nun aber auch nicht, ob man mit diesem Ansatz der Seite noch zuweisen kann, dass Sie am Nullpunkt stoppt.
ich hoffe das ist verständlich
Grüße
Moki
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Horizontal und vertikal zentriert</title>
<style type="text/css" media="screen"><!--
body
{
color: white;
background-color: #003;
margin: 0;
overflow: hidden }
#horizon
{
color: white;
background-color: transparent;
text-align: center;
position: absolute;
top: 50%;
left: 0px;
width: 100%;
height: 1px;
overflow: visible;
visibility: visible;
display: block
}
#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: grey;
margin-left: -300px;
position: absolute;
top: -200px;
left: 50%;
width: 600px;
height: 400px;
visibility: visible
}
.bodytext
{
font-size: 14px
}
.headline
{
font-weight: bold;
font-size: 24px
}
#footer
{
font-size: 11px;
font-family: Verdana, Geneva, Arial, sans-serif;
text-align: center;
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
height: 20px;
visibility: visible;
display: block
}
a:link, a:visited
{
color: #06f;
text-decoration: none
}
a:hover
{
color: red;
text-decoration: none
}
--></style>
</head>
<body>
<div id="horizon">
<div id="content">
<div class="bodytext">
Diese Fläche ist<br>
<span class="headline">WIRKLICH ZENTRIERT</span>und bleibt auch hier stehen!
<p>Als HTML-Seite, für XHTML unten klicken,</p>
<p>geht nicht mit IE!</p>
</div>
</div>
</div>
<div id="footer">
<a href="rahmencxhtml.html">mit XHTML</a></div>
</body>
</html>