IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Mise en page CSS Discussion :

Problème Alignement sous IE6


Sujet :

Positionnement en CSS

  1. #1
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    47
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations forums :
    Inscription : Octobre 2005
    Messages : 47
    Points : 46
    Points
    46
    Par défaut Problème Alignement sous IE6
    Bonjour,


    J'ai un problème d'alignement avec Internet Explorer 6, mais malgré toutes mes lectures sur les différents posts, je ne trouve pas de solutions.

    Je réalise un site qui suit la forme suivante, assez classique :


    Seulement, dans la partie contenu, j'affiche un tableau de données. Si le tableau est de taille plus petite que le bloc "contenu", celui ci est affiché correctement a droite du menu.

    Mais si mon tableau est plus grand, au lieu de toujours l'afficher à droite du menu, internet explorer le décale en dessous.

    Ceci est apparemment un pb connu mais je n'arrive pas a le corriger

    Voici mes feuilles de style :

    site.css
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
     
    .xleft, #bannerLeft img {
      float:left;
    }
    .xright, #bannerRight img {
      float:right;
    }
    #banner {
      padding: 0px;
      height: 50px;
      background-color: #B8C7F3;
      border-bottom: 1px solid #fff;
    }
    #banner  a#bannerRight img {
    	margin: 10px 10px 0 0 !important;
    }
    #banner  a#bannerLeft img {
    	margin: 5px 0 0 5px !important;
    }
    #banner p#titreBanner {
      padding: 10px 0 0 0 !important;
      font-size: x-large;
      font-weight: bold;
      color: #4477AA;
    }
    #breadcrumbs {
    	overflow: hidden;
    	padding: 3px 10px 3px 10px;
    	background-image: url(./../images/breadcrumbs6.png);
    	background-repeat: repeat-x;
    	border: none;
    	background-color: #fff !important;
    }
    #breadcrumbs a {
    	font-weight: bold;
    	color: #555;
    	text-decoration: underline;
    }
    #leftColumn {
     width: 180px;
     float:left;
     overflow: auto;
     margin: 10px 0 10px 4px;
     border: 1px solid #ccc;
     border-top: none;
     border-left: none;
     padding-right: 0;
     padding-left: 0;
     background-color: #B8C7F3;
    }
    #leftColumn a {
    	text-decoration: none;
    }
    #bodyColumn {
      margin-left: 197px;
    }
    #navcolumn {
    	margin: 0 !important;
    	padding: 0 !important;
    	height: 380px; /*hauteur du menu de gauche*/
    }
    #navcolumn ul {
      margin: 3px 0 5px 0;
      padding: 0;
      font-size: small;
    }
    #navcolumn li {
      list-style-type: none;
      background-image: none;
      background-repeat: no-repeat;
      background-position: 0 0.4em;
      padding-left: 16px;
      list-style-position: outside;
      line-height: 1.2em;
      font-size: smaller;
    }
    #navcolumn ul a {
    	color: #333333;
    }
    #navcolumn ul a:hover {
    	color: red;
    }
    #navcolumn ul li {
    	background-image: url(./../images/list3.png);
    	background-position: top left;
    }
    #navcolumn h5 {
    	font-size: 11px;
    	padding: 1px 0 1px 12px;
    	color: #4477AA;
    	background-position: left 5px;
    	font-variant: small-caps;
    	border: none;
    	border-bottom: 0px solid #ccc;
    	border-top: 1px solid #ccc;
    	background-color: #B8C7F3;
    }
    #navcolumn h6 {
    	font-size: 11px;
    	padding: 1px 0 1px 12px;
    	background-position: left 5px;
    	font-variant: small-caps;
    	border: none;
    	background-color: #B8C7F3;
    }
    h2 {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 28px;
      color: #666;
      background: none;
      font-weight: normal;
      padding-left: 0;
      border: none;
      border-bottom: 1px dotted #ccc;
    }
    h3 {
    	font-family: Arial, Helvetica, sans-serif;
    	padding: 4px 4px 4px 0;
    	color: #999 !important;
    	background: none;
    	font-weight: normal;
     
    	border: none;
    	border-bottom: 1px dotted #ccc;
    }
    h4 {
      padding: 4px 4px 4px 6px;
      border: 1px solid #bbb;
      color: #900;
      background-color: #fff;
      font-weight: normal;
      font-size: large;
    }
    h5 {
      padding: 4px 4px 4px 6px;
      color: #900;
      /*font-size: normal;*/
    }
    #footer {
    	padding: 10px;
    	margin: 20px 0px 20px 0px;
    	border-top: solid #ccc 1px;
    	color: #333333;
    }
    body {
    	background-color: #e2f3b8;
    	font-family: Verdana, Helvetica, Arial, sans-serif;
    	background-repeat: repeat-y;
    	font-size: 13px;
    	padding: 0px;
    	margin: 0px;
    }
    td,select,input,li {
    	font-family: Verdana, Helvetica, Arial, sans-serif;
    	font-size: 12px;
    	color: #333;
    }
    a {
    	text-decoration: underline;
    }
    a:link {
    	color: #47a;
    }
    a:visited {
    	color: #666;
    }
    a:active,a:hover {
    	color: #900;
    }
    p {
    	line-height: 1.3em;
    	font-size: 12px;
    	color: #000;
    }
     
    div.clear{
      clear:both;
      visibility: hidden;
    }
    div.clear hr{
      display: none;
    }
    img {
      border:none;
    }
    hr {
    	border: none;
    	border-bottom: 1px solid #ccc;
    	background-color: transparent;
    	height: 1px;
    }
    #breadcrumbs,#footer,#navcolumn li {
    	font-size: 10px;
    }
    screen.css
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    @import url("displaytag.css");
     
    body,input,select,td,textarea {
    	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    }
     
    h4,h5,h6,p,strong,div,form,acronym,label,table,td,th,span,a,hr,code,pre,hr
    	{
    	margin: 0;
    	padding: 0;
    	font-size: 1em;
    	background-repeat: no-repeat;
    	list-style-type: none;
    }
     
    a,a:visited,a:hover {
    	color: #666;
    	text-decoration: none;
    }
     
    a:hover {
    	text-decoration: underline;
    }
     
    table hr {
    	height: 1px;
    	/*clear: both;*/
    	/*margin: none;*/
    	width: 100%;
    }
     
    hr {
    	height: 1px;
    	color: #fff;
    	border: none;
    	border-top: 1px dotted #ccc;
    	margin: 20px 0 20px 0;
    	width: 50%;
    }
    displaytag.css
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    table {
    	margin: 5px 0 5px 0 !important;
    	width: 100%;
    }
     
    th,td {
    	padding: 2px 4px 2px 4px !important;
    	text-align: left;
    	vertical-align: top;
    	white-space: nowrap;
    }
     
    thead tr {
    	background-color: #fc0;
    }
     
    th.sorted {
    	background-color: orange;
    }
     
    th a,th a:visited {
    	color: black;
    }
     
    th a:hover {
    	text-decoration: underline;
    	color: black;
    }
     
    th.sorted a,th.sortable a {
    	background-position: right;
    	display: block;
    	width: 100%;
    }
     
    th.sortable a {
    	background-image: url(./../images/arrow_off.png);
    }
     
    th.order1 a {
    	background-image: url(./../images/arrow_down.png);
    }
     
    th.order2 a {
    	background-image: url(./../images/arrow_up.png);
    }
     
    tr.odd {
    	background-color: #fff
    }
     
    tr.tableRowEven,tr.even {
    	background-color: #fea
    }
     
    div.exportlinks {
    	padding: 2px 4px 2px 4px;
    	margin: 0 0 20px 0;
    }
     
    span.export {
    	padding: 0 4px 1px 20px;
    	display: inline;
    	display: inline-block;
    	cursor: pointer;
    }
     
    span.excel {
    	background-image: url(./../images/ico_file_excel.png);
    }
     
    span.csv {
    	background-image: url(./../images/ico_file_csv.png);
    }
     
    span.xml {
    	background-image: url(./../images/ico_file_xml.png);
    }
     
    span.pdf {
    	background-image: url(./../images/ico_file_pdf.png);
    }
     
    span.rtf {
    	background-image: url(./../images/ico_file_rtf.png);
    }
     
    span.pagebanner {
    	padding: 2px 4px 2px 4px;
    	margin-top: 0;
    	border-bottom: none;
    }
     
    span.pagelinks {
    	padding: 2px 4px 2px 4px;
    	border-top: none;
    	margin-bottom: 0;
    }
    table.mars thead tr {
    	background-color: #9c9;
    }
     
    table.mars tr.even {
    	background-color: #ccb;
    }
     
    table.mars tr.odd {
    	background-color: #eec;
    }
    Et voici un exemple de page html :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
     
     
     
     
     
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    		<title></title>
    		<style media="all" type="text/css">
          		@import url("/css/site.css");
          		@import url("/css/screen.css");	
    	</head>
     
    	<body>
    		<div id="banner">
    			<a href="javascript:;" id="bannerLeft">
    				<img src="logo.png"/>
    			</a>
    			<p id="titreBanner">page</p>
    			<div class="clear">
    				<hr/>
    			</div>
    		</div>
    		<div id="breadcrumbs">
    			<div class="xleft">
    				<a href="/accueil.html">Accueil</a>
        		        </div>
    			<div class="xright">
    				<a href="javascript:;">Aide</a>
        		        </div>
        		        <div class="clear">
        			       <hr/>
        		         </div>
        	        </div>
        	<div id="leftColumn">
        		<div id="navcolumn">
        			<h5>MENU</h5>
        				<ul>
        					<li>
        						Menu 1
        					</li>
        				</ul>								
        		</div>
        	</div>
    		<div id="bodyColumn">
    			<div id="contentBox">
     
                    <h3>Titre du contenu</h3>
    		<div>
    		<span class="pagebanner">BlaBla</span>
                    <span class="pagelinks">BlaBla</span>
    <table>
    <thead>
    <tr>
    <th>BlabLa</th>
    <th>BlabLa</th>
    <th>BlabLa</th>
    etc...
    </tr>
    </thead>
    <tbody>
    <tr >
    <td></td>
    <td></td>
    etc.....
    </tr>
    </tbody>
    </table>
    <div class="exportlinks">BlabLa</div>
    </div>
    <br>
    <a href="accueil">Accueil</a>
    </div>
    </div>
    		<div class="clear">
    			<hr />
    		</div>
    		<div id="footer">
    			<div class="xright">Pied de page</div>
    			<div class="clear">
    				<hr />
    			</div>
    		</div>
    	</body>
    </html>
    Désolé pour le "formattage" de ce fichier mais c dur a modifier dans les balises Code

  2. #2
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    47
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations forums :
    Inscription : Octobre 2005
    Messages : 47
    Points : 46
    Points
    46
    Par défaut
    Pour expliquer un peu mieux, enfin j'espère:
    j'ai un menu avec float:left
    j'ai un contenu : je ne veux pas que internet explorer me décale le contenu en dessous du menu si les données prennent trop de place.
    J'ai essayé de mettre un float:left sur le contenu (balise bodyColumn) mais rien ne change.

  3. #3
    Membre émérite
    Avatar de Candygirl
    Femme Profil pro
    Inscrit en
    Juillet 2006
    Messages
    1 912
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 52
    Localisation : Suisse

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 912
    Points : 2 907
    Points
    2 907
    Par défaut
    Bonjour,

    c'est à cause du bug des 3px sur IE6. En réalité tu as 100%-3px à disposition sur IE6, à côté de ton flottant. IE6 estime donc qu'il n'a pas la place pour afficher ton tableau à côté du flottant et le passe au-dessous.

    Tu peux le corriger en spécifiant un css à l'intention de IE6-, par exemple:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    <!--[if lt IE 7]>
      <style type="text/css">
        #bodyColumn{
          position:relative;
          left:-3px;
          margin-right:-3px;
          height:1%; /* donne le layout */
        }
      </style>
    <![endif]-->
    En fesant une recherche sur le forum avec "bug des 3px" ou sur google avec "3px jog" tu devrais trouver quelques informations.

    Par exemple:

    http://www.developpez.net/forums/sho...hlight=bug+3px

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème flash sous ie6
    Par pp51 dans le forum Intégration
    Réponses: 3
    Dernier message: 30/10/2008, 09h27
  2. Problème alignement dans cellule sous IE
    Par mauriceuh dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 12/02/2007, 13h08
  3. Problème d'affichage des styles sous IE6
    Par Theberge43 dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 16/01/2007, 19h21
  4. [XHTML] Problème d'affichage sous IE6
    Par Emotion dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 06/01/2007, 14h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo