Centre une div ie6

Résolu
pupuce -  
 pupuce -
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 !
Configuration: Windows XP
Firefox 3.5.3

3 réponses

  1. RAD ZONE Messages postés 5362 Statut Contributeur 1 360
     
    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
  2. Utilisateur anonyme
     
    Centrer verticalement ou horizontalement ?

    0