M
Maik
Einfach so
mfg Maik
HTML:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS-Beispiel 1: position_fixed</title>
<style type="text/css">
<!--
html, body {
width: 100%;
height: 100%;
margin: 0;
border: 0;
padding: 0;
}
body {
overflow: hidden; /* Scrollbalken im Fenster unterbinden */
margin-left: 0px;
}
#mitte {
position: absolute;
left: 0px; /* Abstand zum linken Fensterrand */
top: 70px; /* Abstand zum oberen Fensterrand */
right: 0; /* Abstand zum rechten Fensterrand */
bottom: 50px; /* Abstand zum unteren Fensterrand */
overflow: auto; /* Scrollbalken, falls notwendig */
/* nur für IE: */
width: expression((document.body.clientWidth - 300) + "px");
/* left-Wert + right-Wert = 300 */
height: expression((document.body.clientHeight - 200) + "px"); /* top-Wert + bottom-Wert = 200 */
}
#mitte .inhaltDiv {
margin: 20px; /* Abstand des Inhalts zum Blockrand */
}
#oben {
position: absolute;
top: 0; /* Abstand zum oberen Fensterrand */
left: 0; /* Abstand zum linken Fensterrand */
right: 0; /* Abstand zum rechten Fensterrand */
height: 70px; /* Blockhöhe */
padding: 0; /* Interpretation Boxmodell! */
background-color: #fff;
overflow: hidden; /* Scrollbalken unterbinden */
/* nur für IE: */
width: expression(document.body.clientWidth + "px");
/* left-Wert + right-Wert = 0 */
}
#oben .inhaltDiv {
margin: 10px; /* Abstand des Inhalts zum Blockrand */
}
#unten {
position: absolute;
left: 0px; /* Abstand zum linken Fensterrand */
bottom: 0 !important; /* Abstand zum unteren Fensterrand */
bottom: -1px; /* nur für IE */
right: 0; /* Abstand zum rechten Fensterrand */
height: 75px; /* Blockhöhe */
padding: 0; /* Interpretation Boxmodell! */
background-color: #fff;
overflow: hidden; /* Scrollbalken unterbinden */
/* nur für IE: */
width: expression((document.body.clientWidth - 200) + "px");
/* left-Wert + right-Wert = 200 */
}
#unten .inhaltDiv {
margin: 10px; /* Abstand des Inhalts zum Blockrand */
}
.Stil39 { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #FF0000;
font-weight: bold
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #000000;
}
a:active {
color: #FF0000;
}
.outer {
position:relative;
display:table;
height: 100%;
width: 100%;
vertical-align: middle;
text-align: center;
background:red;
float:left
}
.inner {
width:100%;
display:table-cell;
vertical-align:middle;
position:relative;
}
-->
</style>
<!--[if IE ]>
<style type="text/css">
.inner {top:50%;left:0;}
.inner p{top:-50%; position:relative;}
</style>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<body>
<div id="mitte">
<div class="outer">
<div class="inner">
<p>This is some random text : </p>
</div>
</div>
</div>
<div id="oben">
<div class="inhaltDiv">
</div>
</div>
<div id="unten">
<div class="inhaltDiv">
</div>
</div>
</body>
</html>
mfg Maik