Centre une div ie6

Résolu/Fermé
pupuce - 14 oct. 2009 à 13:27
 pupuce - 14 oct. 2009 à 15:57
Bonjour,

je voudrais savoir si il est possible de centré une DIV sous EI 6, car avec

margin-left: auto;
margin-right: auto;

ou alor

<div id="boite" align="center">
sa marche pas !

3 réponses

RAD ZONE Messages postés 5224 Date d'inscription samedi 20 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 1 353
14 oct. 2009 à 14:46
Si c est un central total voila un exemple

<!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>
    <title>
      RAD ZONE Webcreation
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="author" content="http://radservebeer.free.fr" />
    <meta name="generator" content="PSPad editor, www.pspad.com" />
<style type="text/css">
  /*<![CDATA[*/
   body {
     margin: 0;
     text-align: center; /* pour corriger le bug de centrage IE */
     }

     #boite {
     background-color: #FFFF99;
     position:absolute;
     left: 50%;
     top: 50%;
     width: 400px;
     height: 200px;
     margin-left: -200px; /* moitié de la largeur */
     margin-top: -100px; /* moitié de la hauteur */
     border: 1px solid #000;
     text-align: left; /* pour réaligner le texte a gauche */
      }
  /*]]>*/
</style>
  </head>
  <body>
    <div id="boite">
      DIV boite
    </div>
  </body>
</html>

1
Utilisateur anonyme
14 oct. 2009 à 14:08
Centrer verticalement ou horizontalement ?

0
ok merci
0