Partage
  • Partager sur Facebook
  • Partager sur Twitter

[CSS]Problème de centrage de page....

j'ai un problème avec le centrage de ma page, aidez moi svp !

    8 mai 2006 à 15:06:20

    Bonjour,

    voila j'essaye de centrer mon site, donc en se qui concerne le header, le menu du haut et le contenu ces bon car c'est centrer, mais en ce qui concerne le menu il reste à gauche et ne veu pas s'aligner à coté du menu dans le fond.

    voici mon css :


    /* Copyright 2006. Cette feuille de style(css) apartient à esprit-pc.net toutes copie est totalement interite .*/

      body {
               background-image : url("/images/webdesign/Esprit-pc_wallp.png");
               background-attachment : scroll;
               background-position : center;
               background-repeat : repeat-y;
               color : #515051;
                       margin : center;
                      
          }
     #header {
               width : 845px;
               height : 162px;
               background-image : url("/images/webdesign/Esprit-pc_header.png");
               background-repeat : no-repeat;
                       margin : auto;
          }
     #headerdown {
               width : 847px;
               height : 36px;
               background-image : url("/images/webdesign/Esprit-pc_header-down.png");
               background-repeat : no-repeat;
                       margin : auto;
          }
     #menu {
                       margin : auto;
               margin-top : 20px;
               float : left;
               width : 155px;
               background-image : url("/images/webdesign/Esprit-pc_main_wallp.png");
               margin-bottom : 3px;
               font-family : Verdana, Arial, serif;
               font-size : 13px;
          }
     #menu a {
               text-decoration : none;
               color : #4c6e8e;
               font-size : 13px;
          }
     #menu a:visited {
               text-decoration : none;
               color : #4c6e8e;
               font-size : 13px;
          }
     #menu a:hover {
               color : #231fe6;
               font-size : 13px;
               padding-left : 3px;
          }
     #contenu {
               margin-top : 1px;
               margin : auto;
               margin-bottom : 3px;
               width : 680px;
          }
              
     .citation td {
                            border : 1px solid black;
                            border-collapse : collapse;
                            background-color : #FFFFFF;
                            width : 500px;
                            margin : auto;
              }
     .actu02 h4 {
               color : #34386d;
          }
     .telechargement a {
               color : #315e81;
          }
     .telechargement a:visited {
               color : #315e81;
          }
     .telechargement a:hover {
               color : #999999;
          }
     .spécial {
               border : 1px;
               border-style : dashed;
               background : #ffffff;
          }
     .admin_mess {
               border : 1px;
               border-style : dashed;
               background : #e7e7e7;
          }
     h4 {
               font-family : Verdana, Arial, serif;
               color : blue;
               font-size : 13px;
          }
     .actu table {
               text-align : center;
          }
     .tbl_f_s {
               height : 5px;
          }
     a {
               color : blue;
               text-decoration : none;
          }
     a:visited {
               color : blue;
               text-decoration : none;
          }
     a:hover {
               color : red;
          }
     h1 {
               text-align : center;
          }
     input {
               border : 1px;
               color : #716fce;
               background-image : url("/images/webdesign/Esprit-pc_wallp_input.png");
          }
     input:hover {
               color : #afafb1;
               background-image : url("/images/webdesign/Esprit-pc_wallp_input.png");
          }
     .connect a {
               font-size : 13px;
               color : #4990df;
               text-decoration : none;
          }
     .connect a:visited {
               font-size : 13px;
               color : #4990df;
               text-decoration : none;
          }
     .connect a:hover {
               font-size : 12px;
               color : #ff0000;
          }
     .headerdown {
               padding-top : 6px;
               font-size : 14px;
          }
     .headerdown a {
               text-decoration : none;
               font-size : 14px;
               color : #c06030;
               font-weight : bold;
          }
     .headerdown a:visited {
               text-decoration : none;
               font-size : 14px;
               color : #c06030;
               font-weight : bold;
          }
     .headerdown a:hover {
               text-decoration : overline;
               font-size : 14px;
               color : #db926e;
               margin-bottom : 3px;
          }
     #footer {
               background-image : url("/images/webdesign/Esprit-pc_footer.png");
               width : 688px;
               height : 85px;
               margin-left : 160px;
               text-align : center;
               color : #646464;
               font-size : 13px;
               margin-top : 30px;
          }


    pouvez vous m'aidez svp !

    merci

    voici la page :

    http://www.esprit-pc.net
    • Partager sur Facebook
    • Partager sur Twitter
      8 mai 2006 à 15:13:44

      rajoute dans ton code css, a l'intérieur de la balise body: margin: auto;
      • Partager sur Facebook
      • Partager sur Twitter
        8 mai 2006 à 15:24:04

        Hep !

        Personnellement, je spécifierais une largeur à mon body, et je rajouterais margin: auto;... Parce que visiblement, ton corps occupe toute la largeur de la page si le menu est collé a gauche ! :-°

        Du genre :

        body
        {
        width: /*ta largeur*/ ;
        margin: auto;
        }


        EDIT : Enlève aussi margin: center; à ton body, ça veut rien dire, je crois... o_O
        • Partager sur Facebook
        • Partager sur Twitter
          8 mai 2006 à 15:29:01

          sa marche ! merci beaucoup Bilbou ! je n'y avais même pas penser !

          sauf sous IE
          • Partager sur Facebook
          • Partager sur Twitter
            8 mai 2006 à 15:52:51

            Citation : n0delO

            sa marche ! merci beaucoup Bilbou ! je n'y avais même pas penser !

            sauf sous IE



            T'as lu mon lien ? -_-
            • Partager sur Facebook
            • Partager sur Twitter

            [CSS]Problème de centrage de page....

            × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
            × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
            • Editeur
            • Markdown