28220 sujets

CSS et mise en forme, CSS3

Bonjour,

J'ai bien suivi les explications de cette FAQ concernant une hauteur à 100%.

J'ai donc appliqué aux parents de mon bloc (à savoir body et html) un height:100%. À mon bloc, j'ai appliqué un positionnement absolu, et lui ai donné une hauteur de 100% aussi.

http://www.exoconcept.ch/tests/sic/

Apparemment cela ne suffit pas pour FF (alors que ça fonctionne sous IE). En effet, le 100% est inteprété par FF comme étant la hauteur actuelle de la fenêtre. Et si on scrolle... catastrophe, le bloc a cessé de s'étendre au-dehors de la limite de ladite fenêtre.

Y'a-t-il un "truc" que j'aurais loupé concernant FF ?

Merci d'avance.
Modifié par Corinne (21 Oct 2005 - 14:54)
c'est p't-être bête, mais si tu mets un position:fixed sur ton block, sa devrait contourner le problème (sans le résoudre...?)
chankalan a écrit :
c'est p't-être bête, mais si tu mets un position:fixed sur ton block, sa devrait contourner le problème (sans le résoudre...?)

sur le fond du block en fait...
Essayes:
#content {
	position: absolute;
	width: 679px;
	height: [#red]auto[/#];
	background-color: #FFFFFF;
}


Smiley biggrin
Modifié par Igor (22 Oct 2005 - 19:48)
Salut à tous et merci pour vos réponses !

chankalan a écrit :
si tu mets un position:fixed sur ton block

Si j'utilise cette position, sous FF je n'ai carrément plus la possibilité de scroller ma page ! C'est fort étrange ^^

Nyro Xeo a écrit :
html>body #global
{
min-height: 100%;
height: auto;
}


Sinon pour ton exemple Nyro, j'ai trouvé ceci qui m'intrigue beaucoup. Je n'ai jamais vu cette notation html>body #global, je ne comprends pas trop, tu pourrais m'expliquer s'il te plaît ?

6Sonic a écrit :
Essayes:
#content {
position: absolute;
width: 679px;
height: auto;
background-color: #FFFFFF;
}


Cela n'arrange pas le problème, pire, ça ne marche plus même sur IE avec cette solution Smiley smile
Sk4pis0 a écrit :
J'ai le meme probleme que toi l'ami. Tu pourrais me dire ce qu'est un box model hack?


Smiley google box model hack peut-être. Ou encore une recherche sur le forum ou bien encore un tour dans la faq, ou dans le post de présentation du salon Ressources Smiley cligne
Bonjour,

j ai aussi le probleme pour la hauteur d un bloc dans FF
en rajoutant position:fixed; mon bloc apparait mais j ai plus de
scroll barre dans FF mais tout marche dans IE
.... meme avec le box model hack ca ne marche pas......

vu que je suis pas encore expert en la matiere... et ce qu il y aurait une bonne ame pour me donner son avis sur mon code?.... Smiley langue

CSS:

body{
margin: 0px;
background-color: #EEEEEE;
}
ul#menu{
margin: 0px;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
list-style-type: none;
padding-top:3px;
}
#menu li{
display:inline;
}
#menu a
{
color: #000000;
text-decoration: none;
margin-right: 15px;
margin-left:15px;
}
#menu a:hover{
color: #007AC0;
}
#centrage
{
position: relative;
width: 686px;
margin: 0 auto;
}
#barremenu
{
clear: both;
width: 636px;
height: 23px;
background: url(../images/bg_menu.gif);
border: 1px solid #9D9D9D;
margin:0px;
padding-left: 50px;
}
#bloc{
clear: both;
width: 686px;
height: 150px;
background-image: url(../images/banner_fond.jpg);
margin:0px;
border-left: 1px solid #9D9D9D;
border-right: 1px solid #9D9D9D;
}
#contenu{
background-color: White;
position: fixed;
width: 686px;
border-right: 1px solid #9D9D9D;
border-left: 1px solid #9D9D9D;
height: 100%;
voice-family: "\"}\"";
voice-family:inherit;
height: 100%;
}
html>body #contenu {
height:100%;
}
#footer{
clear: both;
width: 686px;
height: 20px;
background-image: url(../images/bg_menu.gif);
border: 1px solid #9D9D9D;
}
#divpic{
float: left;
width: 100px;
margin-left:25px;
margin-top:25px;
}
#divcontenu{
float: left;
width: 34px;
margin-left:30px;
margin-top:30px;
}
#divtext{
width:400px;
float: left;
margin-left:30px;
margin-top:60px;
text-align:justify;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
}
#logo{
float:right;
margin-right:10px;
margin-top:30px;
margin-bottom: 10px;
}



HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id=centrage>
<div id=bloc>
<img src="images/header.jpg" height="30" width="686" alt="">
</div>
<div id=barremenu>
<ul id=menu>
<li> | <a href="home.html">Home</a> | </li>
<li><a href="welcome.html">Welcome</a> | </li>
<li><a href="program.html">Program</a> | </li>
<li><a href="news.html">News</a> | </li>
<li><a href="info.html">Practical Info</a> | </li>
<li><a href="contact.html">Contact</a> | </li>
</ul>
</div>
<div id=contenu>
<div id=divpic>
<img src="images/img1.jpg" height="100" width="100" alt="">
<img src="images/img2.jpg" height="100" width="100" alt="">
<img src="images/img3.jpg" height="100" width="100" alt="">
<img src="images/img4.jpg" height="100" width="100" alt="">
</div>
<div id=divcontenu>
<img src="images/home.gif" height="401" width="34" alt="titre menu">
</div>
<div id=divtext>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
</div>
<img id=logo src="images/logo1.gif" alt="">
<img id=logo src="images/logo2.gif" alt="">
</div>
<div id=footer>
</div>
</div>
</body>
</html>


D avance je vous en remercie......
Bonjour Igor,

Ca commence mal pour moi.... Smiley ohwell

je m en vais de ce pat creer un nouveau sujet....

merci
Modifié par toutanne (19 Nov 2005 - 14:58)