Bonjour ou Bonsoir
Mon menu de navigation fonctionne seulement, il y a une partie qui me chiffone pour avoir une navigation agréable. Je vais essai d'expliquer clairement.
Tout d'abord, je vous invite à voir la page d'accueil de mon site : http://www.triebzug.ch
Vous constaterez dans la partie "train" des sous menus sans lien actif. Ces sous menu sont pas de dimention égal au sous menu avec lien actif, ce qui provoque un légé décalage pour les sous menu enfants (appellé choix).
Mon souhait serait que les sous menu enfant soient bien alignés à leur parent.
Pour vous aider à comprendre les codes HTML et CSS de cette partie du menu de navigation :
Le HTML
Code html : 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 Les trains <ul class="sousMenu"> <li> <a href="cff.php">CFF</a> CFF Locomotive <!-- lien sans page--> <ul class="choix"> <li> <a href="ae66.php">Ae 6/6</a> <a href="am840.php">Am 840</a> <a href="bem550.php">Bem 550</a> <a href="ee922.php">Ee 922</a> <a href="ee934.php">Ee 934</a> <a href="re44ii.php">Re 4/4 II</a> <a href="re44iii.php">Re 4/4 III</a> <a href="re450.php">Re 450</a> <a href="re460.php">Re 460</a> <a href="re474.php">Re 474</a> <a href="re481.php">Re 481</a> <a href="re482.php">Re 482</a> <a href="re484.php">Re 484</a> <a href="re66.php">Re 6/6</a> </ul> </li> <li> CFF automotrice <ul class="choix"> <li> <li><a href="rabde500.php">RABDe 500</a></li> <li><a href="rabe511.php">RABe 511</a></li> <li><a href="rabe514.php">RABe 514</a></li> <li><a href="rabe520.php">RABe 520</a></li> <li><a href="rabe521.php">RABe 521</a></li> <li><a href="rabe522.php">RABe 522</a></li> <li><a href="rbde560.php">RBDe 560</a></li> <li><a href="rbde561.php">RBDe 561</a></li> <li><a href="rbde562.php">RBDe 562</a></li> <li><a href="rbe540.php">RBe 540</a></li> <li><a href="tgv.php">TGV</a></li> </ul> </li> <li>
le CSS du menu de navigation :
En vous remerciant d'avance de l'aide.
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 html, body { font: 11px verdana, sans serif; background: transparent url("http:www.triebzug.ch/divers(logobilde.jpg") top center no-repeat; margin:0; padding:0; height:100%; } html>body #wrap {height:100%;} #header { width:100%; height:5em; } html>body #header { position:fixed; z-index:10; } html>body #content-wrap {height:100%;} html>body #content {padding:6em 1em;} #menuDeroulant { width : 3000px; list-style-type: none; margin: 0; padding: 0; border: 0; position: absolute; top: 0; left: 0; } #menuDeroulant li { float: left; width: 150px; margin: 0; padding: 0; border: 0; position: relative; } #menuDeroulant li:hover > .sousMenu { display: block; } #menuDeroulant .sousMenu { display: none; list-style-type: none; margin: 0; padding: 0; border: 0; } #menuderoulant .sousMenu li { float: none; margin: 0; padding: 0; border: 0; width: 149px; border-top: 1px solid transparent; border-right: 1px solid transparent; } #menuDeroulant li a:link, #menuDeroulant li a:visited { display: block; height: 1%; color: #090800; background: #EBDE13; margin: 0; padding: 4px 8px; border-right: 1px solid #090800; text-decoration: none; } #menuDeroulant li a:hover { background-color: #FCBF49; } #menuDeroulant li a:active { background-color: #EBDE13; } #menuDeroulant .sousMenu li a:link, #menuderoulant .sousMenu li a:visited { display: block; color: #090800; margin: 0; border: 0; text-decoration: none; background: transparent url("http://www.triebzug.ch/divers/logobilde.jpg"); } #menuDeroulant .sousMenu li a:hover { background-image: none; background-color: #FCBF49; } #menuDeroulant li:hover > .choix { display: block; } #menuDeroulant .choix { position: absolute; left: 150px; display: none; list-style-type: none; margin: 0; padding: 0; border: 0; top:0; } #menuderoulant .choix li { float: none; margin: 0; padding: 0; border: 0; width: 149px; border-top: 1px solid transparent; border-right: 1px solid transparent; } #menuDeroulant .choix li a:link, #menuderoulant .choix li a:visited { display: block; color: #090800; margin: 0; border: 0; text-decoration: none; background: transparent url("http://www.triebzug.ch/divers/logobilde.jpg"); } #menuDeroulant .choix li a:hover { background-image: none; background-color: #FCBF49; } div#article { margin-left: auto; margin-right: auto; width: 50em; text-align: left; } body#footer { width:100%; height:5em; } html>body #footer { position:fixed; bottom:0; z-index:10; }
Partager