c'est la première fois que je teste des div et j'ai un petit problème :
dans page html:
j'ai 3 div, le premier div global englobe deux div a1 et a2 et ils sont à côtés de l'autre, j'ai utilisé deux fichiers html et l'autre css.
voici le code html:
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Document sans nom</title> <link rel="stylesheet" href="s.css" type="text/css"/> </head> <body> <div id="global"> <div id="a1"></div> <div id="a2"></div> </div> </body> </html>
et le css:
body
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
#global
{
background-color:#CCCCCC;
width:100%;
height:100px;
text-align:center;
}
#a1
{
background-color:#0099FF;
height:100px;
width:200px;
float:left;
}
#a2
{
background-color:#009900;
height:100px;
width:400px;
float:left;
}
le probleme en utilisant ce code, les 2 div a1 et a2 ne se centrent pas meme si j'ai mis dans div global text-align:center
merci d'avance
