Problème de div et de background
Résolu/Fermé
A voir également:
- Problème de div et de background
- Div c++ - Télécharger - Langages
- Windows 7 logon background changer - Télécharger - Thèmes & Fonds d'écran
- Background remover - Télécharger - Montage photo
- Hd audio background process ✓ - Forum Windows
- Moyenne.si.ens #div/0 ✓ - Forum Excel
3 réponses
2 bloc en haut un a gauche un a droite, avec un autre bloc en dessou, mais je ne compren pas pourquoi son background va se coller en haut au lieu de rester a la position du bloc en dessou, ce que je cherche a faire.....
Utilisateur anonyme
9 août 2009 à 15:10
9 août 2009 à 15:10
HTML :
<!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">
<head>
</head>
<body>
<div class="bloc1"></div>
<div class="bloc2"></div>
<div class="bloc3"></div>
</body>
</html>
CSS :
.bloc1 {
float: left;
background:blue;
width: 100px;
height: 100px;
}
.bloc2 {
float: right;
background:red;
width: 100px;
height: 100px
}
.bloc3 {
clear: both;
height: 100px;
width: 100px;
margin: 0 auto;
background:black;
}
<!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">
<head>
</head>
<body>
<div class="bloc1"></div>
<div class="bloc2"></div>
<div class="bloc3"></div>
</body>
</html>
CSS :
.bloc1 {
float: left;
background:blue;
width: 100px;
height: 100px;
}
.bloc2 {
float: right;
background:red;
width: 100px;
height: 100px
}
.bloc3 {
clear: both;
height: 100px;
width: 100px;
margin: 0 auto;
background:black;
}