Centrage

Résolu/Fermé
philoubidou62 Messages postés 7 Date d'inscription mercredi 30 août 2006 Statut Membre Dernière intervention 23 juin 2008 - 4 mars 2008 à 15:43
Gihef Messages postés 5150 Date d'inscription mercredi 20 juillet 2005 Statut Contributeur Dernière intervention 20 février 2023 - 4 mars 2008 à 19:50
Bonjour,

Voilà mon problème : ma page html est centrée sous IE et pas sous Firefox . Quelqu'un peut il m'aider ? (Je débute en CSS)
Voici le css :
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: center;
margin: auto;
}
#principal {
padding: 10px;
width: 900px;
border: 1px solid #9999FF;
left: auto;
text-align: center;
right: auto;
background-color: #FFFFFF;
bottom: auto;
}
#fond {
background-color: #CCCCCC;
height: 100%;
width: 100%;
padding-top: 10px;
position: relative;
}

.important {
font-weight: bold;
color: #660000;
}
#resume {
text-align: center;
margin-bottom: 10px;
padding: 4px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #FF3300;
}


#menu {
text-align: left;
left: 0px;
top: 0px;
width: 900px;
margin-bottom: 10px;
position: relative;
}
#photo1 {
display: inline;
border: 1px solid #FF3300;
}
.photogauche {
float: right;
margin-right: 10px;
margin-top: 10px;
}

#pied {
text-align: center;
margin-top: 10px;
}

.texte {
line-height: 14px;
text-align: justify;
}

#acces {
position:absolute;
left:744px;
width:140px;
height:132px;
z-index:1;
background-color: #FF9966;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 5px;
top: 0px;
}

#page {
text-align: left;
margin-top: 20px;
}
.titre {
font-size: 200%;
background-color: #FFFFFF;
margin-bottom: 5px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-bottom-style: solid;
border-bottom-color: #FF6600;
width: 800px;
}
#encadre {
width: 200px;
padding: 5px;
float: left;
margin-right: 10px;
background-color: #C4C7EE;
border: 1px solid #330099;
}
#titrenews {
padding: 4px;
height: 100%;
}
#actu {
font-size: 12px;
background-color: #FF6600;
color: #FF6600;
padding: 1px;
border: 1px solid #FF3300;
}
#encadredroit {
width: 200px;
padding: 5px;
float: right;
background-color: #B8B8F8;
border: 1px solid #330099;
margin-left: 10px;
height: 20px;
}
#debouches {
background-color: #DFDFFF;
margin-right: 100px;
margin-left: 100px;
padding: 20px;
}
.txtactus {
padding-top: 0px;
padding-right: 2px;
padding-bottom: 0px;
padding-left: 6px;
}

2 réponses

sfel Messages postés 1640 Date d'inscription lundi 18 juin 2007 Statut Membre Dernière intervention 15 juillet 2009 430
4 mars 2008 à 18:27
bonjour,

pourrais-tu nous préciser pour qu'elle classe ?

sinon peut-etre ton problème vient du fait que tu as des fois text-align: center; et des fois text-align: justify;

exemple ici

.texte {
line-height: 14px;
text-align: justify;
}
0
philoubidou62 Messages postés 7 Date d'inscription mercredi 30 août 2006 Statut Membre Dernière intervention 23 juin 2008
4 mars 2008 à 18:44
En fait c'est la page entière qui est décalée sur la gauche sous firefox alors qu'elle est centrée sur IE
je te donne l'adresse http://annecridumi.neuf.fr

Merci de ton aide
0
Gihef Messages postés 5150 Date d'inscription mercredi 20 juillet 2005 Statut Contributeur Dernière intervention 20 février 2023 2 775
4 mars 2008 à 18:42
Bonjour,

Sans en voir plus, je suppose que le #principal sert à regrouper les autres.

Aors, essaye
#principal {
  padding: 10px;
  width: 900px;
  border: 1px solid #99f;
  background-color: #fff;
margin : 0 auto;
  }


++
Inutile de poster plusieurs fois la même question.

Merci de penser à utiliser le bouton indiqué.

 --
0
philoubidou62 Messages postés 7 Date d'inscription mercredi 30 août 2006 Statut Membre Dernière intervention 23 juin 2008
4 mars 2008 à 19:45
Bonsoir,
Super, ça fonctionne, je comprends pas tout, mais l'important c'est que ça marche. Merci infiniment.


Salut
0
Gihef Messages postés 5150 Date d'inscription mercredi 20 juillet 2005 Statut Contributeur Dernière intervention 20 février 2023 2 775 > philoubidou62 Messages postés 7 Date d'inscription mercredi 30 août 2006 Statut Membre Dernière intervention 23 juin 2008
4 mars 2008 à 19:50
Il suffit de coder correctement (-;

 --
0