Bonjour, j'ai quelques difficultés à garder une taille de 90% en hauteur pour un div lorsqu'il y a du texte dedans.
comment puis-je faire?
voici un exemple de code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Test cadre 90% de haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.test {
height: 90%;
width: 90%;
background-color: #000066;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 1;
left: 5%;
top: 5%;
right: 95%;
bottom: 95%;
}
-->
</style>
</head>
<body>
<div id="test" style="position:absolute; z-index:1" class="test">
<p>Comment faire</p>
<p>pour que le cadre bleu</p>
<p>ne s'arrête pas après la dernière ligne</p>
<p>mais fasse 90% de haut comme il est indiqué en css</p>
<p>bien sûre en restant conforme aux normes du xhtml</p>
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a></p>
</div>
</body>
</html>
comment puis-je faire?
voici un exemple de code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Test cadre 90% de haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.test {
height: 90%;
width: 90%;
background-color: #000066;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 1;
left: 5%;
top: 5%;
right: 95%;
bottom: 95%;
}
-->
</style>
</head>
<body>
<div id="test" style="position:absolute; z-index:1" class="test">
<p>Comment faire</p>
<p>pour que le cadre bleu</p>
<p>ne s'arrête pas après la dernière ligne</p>
<p>mais fasse 90% de haut comme il est indiqué en css</p>
<p>bien sûre en restant conforme aux normes du xhtml</p>
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a></p>
</div>
</body>
</html>