Bonjour,
J'ai un problème d'affichage en display block. Je m'explique, voici un code qui fonctionne bien sous Firefox 2 et IE6.
Le problème c'est que je veux que la coloration lors du survol se fasse sur toute la ligne (enfin au moins jusqu'à la bordure droite du conteneur).
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" /> <title>untitled</title> <style TYPE="text/css"> #menuGauche { width: 205px; float: left; padding-top: 10px; background-image: url("../images/menu-gauche-haut.gif"); background-position: top; background-repeat: no-repeat; } #menuGauche a, #menuGauche a:visited { color: #000000; } #menuGauche li.titre1 { margin: 15px 0 0 0; padding: 0 0 0 35px; font-size: 0.81em; /* 13px */ line-height: 1.4em; font-weight: bold; color: #2F2E32; } #menuGauche li.titre1 li a.selected { background-color: #DEE77C; } #menuGauche li.titre2 { margin: 0em; padding: 15px 0 0 35px; font-size: 0.81em; /* 13px */ line-height: 1.4em; font-weight: bold; color: #2F2E32; } #menuGauche li.titre2 li a.selected { background-color: #D0F0A5; } #menuGauche li.titre3 { margin: 0em; padding: 15px 0 0 35px; font-size: 0.81em; /* 13px */ line-height: 1.4em; font-weight: bold; color: #2F2E32; } #menuGauche ul li ul { margin: 0 0 14px -35px; font-weight: bold; padding: 6px 0 0 35px; } #menuGauche ul { list-style: none; margin: 0; padding: 0 0 20px 0; } #menuGauche li { margin: 5px 0 0 0; padding: 0; list-style: none; font-size: 0.75em; /* 12px */ line-height: 1em; /* pour ne pas avoir de difference avec IE */ } #menuGauche p.certification { margin: 0; padding: 0 0 0 35px; text-decoration: none; } #menuGauche ul li ul li { line-height: 1.4em; } #menuGauche ul li ul.smenuGauche { margin: 0em; padding: 0em; font-weight: normal; background: none; } #menuGauche ul li ul.smenuGauche li { margin: 0 0 0 15px; padding: 5px 0 0 0; list-style: disc; font-size: 1em; line-height: 1.2em; } </style> </head> <body> <div id="menuGauche"> <ul> <li class="titre1">Titre Menu1 <ul> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 1</a></li> <li><a href="javascript:void(0);" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 2</a> <div id="sMenu1"> <ul class="smenuGauche"> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-1</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-2</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-3</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-4</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-5</a></li> </ul> </div> </li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 3</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 4</a></li> </ul> </li> <li class="titre2">Titre Menu2 <ul> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 1</a></li> <li><a href="javascript:void(0);" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 2</a> <div id="sMenu1"> <ul class="smenuGauche"> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-1</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-2</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-3</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-4</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">sous rubrique 2-5</a></li> </ul> </div> </li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 3</a></li> <li><a href="#" onmouseover="javascript:this.className='selected'" onmouseout="javascript:this.className=''">rubrique 4</a></li> </ul> </li> </ul> </div> </body> </html>
Si je change la propriété css pour #menuGauche a en ceci :
Cela fonctionne mais IE6 réagit différemment et m'introduit un espacement que je n'ai pas réussi à enlever même en ajoutant ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 #menuGauche a, #menuGauche a:visited { color: #000000; display: block; }
Est ce que quelqu'un aurait une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #menuGauche a, #menuGauche a:visited { color: #000000; display: block; margin: 0 0 0 0 !important; padding: 0 0 0 0 !important; }
merci
Partager