body, html {
height: 100%;
margin: 0;
padding: 0;
}
#container {
height: 100%;
height: auto !important;
margin: 0 auto;
min-height: 100%;
position: relative;
width: 100%;
}
.header {
display: block;
height: 100px;
width: 100%;
}
.body-left {
float: left;
width: 70%;
}
.body-right {
float: right;
width: 30%;
}
.clear {
clear: both;
}
.footer {
float: left;
width: 70%;
}
et HTML
<div id="container">
<div class="header"></div>
<div class="body-left"></div>
<div class="body-right"></div>
<div class="clear"></div>
<div class="footer"></div>
</div>
C'est si c'est ce que vous cherchez
ou utilisez le code JavaScript suivant pour connaître la hauteur et l'affecter à votre conteneur:
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
} else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
} else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
window.onload = init;
function init() {
document.getElementByID("container").style.height = getWindowHeight() + "px";
}
le corps droit est la largeur fixe, pas 30%. disons 150px; –
@Alec Smart vous pouvez changer cela en conséquence, il était juste exemple, j'ai mis à jour ma question sur la hauteur 100% partie et div conteneur ajouté – ant
Que faire body-right {largeur: 150px; float: droite} body-left {margin-right: 150px;} – easwee