Ik heb reeds de vraag gesteld hoe ik mijn header vast bovenaan krijg & de footer vast beneden ongeacht welk venster formaat. Nu zou ik graag willen dat mijn center div (body in css) zich van hoogte aanpast aan de afstand tussen de header & footer en dat wanneer de center div (body) groter is dan die afstand, dat er scrollbars komen.
Nu komt deze ofwel onder mijn footer uit of wel onstaat er witruimte (zie screenshots).
Bekijk bijlage 154287
Bekijk bijlage 154289
CSS code:
html, body {
margin:0;
padding:0;
height:100%;
background: #e5e6e6;
}
#container {
width: 968px;
margin-left: auto;
margin-right: auto;
height:100%;
position:relative;
}
#header {
height: 121px;
}
#nav{
height: 25px;
background-image: url(../images/nav.jpg);
background-repeat: no-repeat;
}
#body {
position: absolute;
overflow-y: auto;
padding-bottom:73px;
background: #666;
}
#footer {
position:absolute;
bottom:0;
width:968px;
height:73px;
background-image: url(../images/footer.jpg);
background-repeat: no-repeat;
}
Nu komt deze ofwel onder mijn footer uit of wel onstaat er witruimte (zie screenshots).
Bekijk bijlage 154287
Bekijk bijlage 154289
CSS code:
html, body {
margin:0;
padding:0;
height:100%;
background: #e5e6e6;
}
#container {
width: 968px;
margin-left: auto;
margin-right: auto;
height:100%;
position:relative;
}
#header {
height: 121px;
}
#nav{
height: 25px;
background-image: url(../images/nav.jpg);
background-repeat: no-repeat;
}
#body {
position: absolute;
overflow-y: auto;
padding-bottom:73px;
background: #666;
}
#footer {
position:absolute;
bottom:0;
width:968px;
height:73px;
background-image: url(../images/footer.jpg);
background-repeat: no-repeat;
}
Laatst bewerkt: