Voici 4 bouts de code CSS très pratiques au quotidien et compatibles avec tous les navigateurs.

(Crédits photos: Exey Panteleev)
Le code HTML:
<div id='conteneur'></div>
Le code CSS:
#conteneur {
margin: 0 auto;
width: 960px;
}
Le code HTML:
<div id='conteneur'> <div id='centre' class='clearfix'> </div> </div> <div id='footer'> </div>
Le code CSS:
* { margin:0; padding:0; }
html, body, #conteneur { height: 100%; }
body > #conteneur {height: auto; min-height: 100%;}
/* La valeur doit être la même que la hauteur du footer */
#centre { padding-bottom: 150px; }
#footer {
position: relative;
/* Doit être la valeur négative de la hauteur du footer */
margin-top: -150px;
height: 150px;
clear:both;
}
/* CLEAR FIX*/
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac */
* html .clearfix { height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
Le code HTML:
<div id='conteneur'></div>
Le code CSS:
#conteneur {
min-height:600px;
height:auto !important;
height:600px;
}
Le code HTML:
<div class='divTransparente'></div>
Le code CSS:
.divTransparente {
/* Modern Browsers */ opacity: 0.7;
/* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
/* IE 5-7 */ filter: alpha(opacity=70);
/* Netscape */ -moz-opacity: 0.7;
/* Safari 1 */ -khtml-opacity: 0.7;
}
Pour poster un commentaire, vous devez être identifié. Vous pouvez choisir parmi ces trois méthodes d'identification:
Compte la Ferme du WebIdentifiez-vousInscrivez-vous |
Compte Facebook |
Compte Twitter
|