Gør container til height: 100%
HejJeg har fundet et eksempellayout på siden
http://css.alsacreations.com/modeles/modele11.htm
Jeg har bakset MEGET med en ændring i CSS'et, så højden på containeren bliver 100%, dvs. top-bjælken og bunden skal være faste, mens menu og frame-div'en skal udfylde resten. Det er stadig frame-diven der skal have scrollbaren - ikke siden.
Jeg vedhæfter den originale kildekode for en god ordens skyld:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>4 zones avec scroll</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
/* CSS issu des tutoriels css.alsacreations.com */
body {
margin: 0;
padding: 0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size: 0.8em;
background-color: #fff; /*couleur de fond blanche*/
}
.conteneur { /*le conteneur global du site, qui sera centré */
position: relative;
width: 750px;
margin: 0 auto;
}
.header {
height: 100px;
background-color: #99CCCC;
}
.menu {
position: absolute;
left:0;
width: 150px;
height: 300px;
background-color:#CCCCFF;
}
.frame {
margin-left: 150px;
width: auto;
height: 300px;
background-color:#9999CC;
overflow: auto;
}
.footer {
height: 20px;
background-color: #99CC99;
}
p {
margin: 0 0 5px 0;
}
.menugauche {
list-style-type: none;
margin: 0;
padding:0;
}
.menugauche li {
margin-bottom: 5px;
}
.menugauche a {
margin: 0 2px;
color: #000000;
text-decoration: underline;
}
.menugauche a:hover {
text-decoration: none;
}
-->
</style>
</head>
<body>
<div class="conteneur">
<div class="header">contenu du header de taille fixe : 750px <a href="http://css.alsacreations.com/Modeles-de-mise-en-page-en-CSS">(voir tous les modèles)</a>
</div>
<div class="menu"><p>menu gauche de largeur fixe : 150px</p>
<ul class="menugauche">
<li><a href="">Menu 1</a></li>
<li><a href="">Menu 2</a></li>
<li><a href="">Menu 3</a></li>
<li><a href="">Menu 4</a></li>
</ul>
</div>
<div class="frame">
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
<p>partie "frame" scrollable </p>
</div>
<div class="footer">contenu du footer de taille fixe :
750px </div>
</div>
</body>
</html>