[WeB]Comment cadrer en CSS ?

Résolu
zogo Messages postés 116 Statut Membre -  
zogo Messages postés 116 Statut Membre -
Bonjour, j'ai fais un site.
J'ai inserer les images en <div id="#"></div>.
et j'aimerais toutes les mettre aux centre, moi j'ai mis ca en CSS :
body
{
margin: auto; <!-- pour centrer le body -->
background: url("img/bg.png") repeat-x 0 0;
background-color: #404040;
font-family: "Trebuchet MS", Verdana, Arial, "Sans Serif";
}
Mais sa ne marche pas ! est-ce que vous avez une autre possibilitée ?
Merci d'avance, ca me sauverais
Configuration: Windows Vista
Firefox 2.0.0.6

2 réponses

  1. Gihef Messages postés 5165 Statut Contributeur 2 781
     
    Bonjour,

    Essaye comme ça :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    
    <head>
    <title></title>
        <meta http-equiv="Content-type" content="text/html; charset=iso-8859-15">
    
        <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
            text-align: center;
    
            background: url(img/bg.png) repeat-x 0 0; 
            background-color: #404040; 
            font-family: "Trebuchet MS", Verdana, Arial, sans-serif; 
            }
        #conteneur {
            position: relative;
            margin: 1em auto;
            width: 760px;
            height: 760px;
            text-align: left;
            border: 1px solid #b0c4de;
            }
        </style>
    
    </head>
    
    <body>
      <div id="conteneur">
    
      </div>
    </body>
    
    </html>

    + “sans-serif” est un nom générique.
    0
  2. zogo Messages postés 116 Statut Membre 5
     
    ah merci, ca marche :)
    0