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 :

Position sous menu dans menu css


Sujet :

Positionnement en CSS

  1. #1
    Membre régulier
    Inscrit en
    Octobre 2008
    Messages
    329
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 329
    Points : 97
    Points
    97
    Par défaut Position sous menu dans menu css
    Bonjour

    Je débute en menu css et j'ai un petit souci :

    J'ai repris un menu existant que j'essaie d'adapter pour apprendre, mais là je séche...

    Je voudrais que dans je développe le sous menu, les options du sous-sous menu soient déjà développées et situées sous le sous-menu, alors qu'actuellement elles ne développent qu'au passage de la souris et décalées sur la droite.

    Voici ce que j'ai actuellement :


    Voici ce que je voudrais obtenir quand un des sous-menu se déroule :


    Le menu est en ligne à cette adresse :
    http://www.imagenko.com/menu.html

    Ca fait des heures que je cherche, mais je n'y arrive pô... J'ai essayé d'enlever le "left:100%;", mais du coup le sous sous-menu chevauche le sous-menu...

    Voici le 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
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    @charset "utf-8";
    /* CSS Document */
    #menu_vert {
    /* no margin/padding so it fills the whole div */
    	margin: 0;
    	padding: 0;
            outline: none;
    }
    .clearb {
    /* needed for some browsers */
    	clear: both;
    }
    #menuwrapper {
    /* set the background color for the menu here */
    	background-color: #fff;
    /* IE6 Hack */
    	height: 1%;
    	width: auto;
    	margin-top: 0px;
    	padding: 0;
    }
     
    ul#primary-nav {
    	list-style-type: none;
    	margin: 0px;
    	padding-top: 0px;
    	padding-left: 80px;
    }
     
    #primary-nav ul {
    /* remove any default bullets */
    	list-style-type: none;
    /* sets width of second level ul to background image */
    	width: 210px;
    	margin: 0px;
    	padding: 0px;
    /* make the ul stay in place so when we hover it lets the drops go over the content instead of displacing it */
    	position: absolute;
    /* Pour que le sous-menu ne soit pas caché par le slideshow */
    z-index: 10;
    /* top being the bottom of the li it comes out of */
    	top: auto;
    /* keeps it hidden till hover event */
    	display: none;
    /* room at top for li so image top shows correct */
    	padding-top: 9px;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav ul {
    	padding-top: 13px;
    }
    #primary-nav ul ul {
    /* insures no top margins */
    	margin-top: 0px;
    /* pulls the last ul back over the preceding ul */
    	margin-left: -1px;
    /* keeps the left side of this ul on the right side of the preceding ul */
    	left: 100%;
    /* negative margin pulls the left centered in li next to it */
    	top: -3px;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav ul ul {
    	margin-top: 0px;
    	padding-left: 5px;
    	left: 100%;
    	top: -7px;
    }
    #primary-nav li {
    /* a little space to the left of each top level menu item */
    	/*margin-left: 5px;*/
    margin-left: 0px;
    /* floating left will set menu items to line up left to right else they will stack top to bottom */
    	float: left;
    }
    #primary-nav li li {
    /* a little more space to the left of each menu item */
    	margin-left: 8px;
    /* keeps them tight to the one above, no missed hovers */
    	margin-top: -1px;
    /* removes the left float set in first li so these will stack from top down */
    	float: none;
    /* relative to the ul they are in */
    	position: relative;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav li li {
    	margin-left: 6px;
    /* helps hold it inside the ul */
    	width: 171px;
    }
    ul#primary-nav li a {
    /* specific font size, this could be larger or smaller than default font size */
    	font-size: 1em;
    /* make sure we keep the font normal */
    	font-weight: normal;
    /* set default link colors */
    	color: #666;
    /* doing tab menus require a bit different padding, this will give room on right for image to show, adjust to width of your image */
    	padding: 0px 11px 0px 0px;
    /* makes it hold a shape */
    	display: block;
    /* remove default "a" underline */
    	text-decoration: none;
    }
    ul#primary-nav li a span {
    /* takes normal "a" padding minus some for right image */
    	padding: 12px 4px 12px 15px;
    /* makes it hold a shape */
    	display: block;
    }
    ul#primary-nav li a:hover {
    /* kind of obvious */
    	background-color: transparent;
    }
    ul#primary-nav li {
    /* set your image here */
    /*	background:  url(uploads/ngrey/nav.gif)  repeat-x left;*/
    }
    ul#primary-nav li span {
    /* set your image here */
    /*	background:  url(uploads/ngrey/nav.gif) repeat-x left;*/
    /* set text color here also to insure color */
    	color: #666;
    /* just to be sure */
    	font-weight: bold;
    }
    ul#primary-nav li li {
    /* remove any image set in first level li */
    	background:  none;
    }
    ul#primary-nav li li span {
    /* remove any image set in first level li span */
    	background:  none;
    /* set text color here also to insure color */
    	color: #666;
    /* just to be sure */
    	font-weight: normal;
    }
    ul#primary-nav li:hover,
    ul#primary-nav li.menuh,
    ul#primary-nav li.menuparenth {
    /* set hover image, right side */
    /*	background:  url(uploads/ngrey/navover.gif) repeat-x left;*/
    Background-color: #ffff00;
    }
    ul#primary-nav li:hover span,
    ul#primary-nav li.menuh span,
    ul#primary-nav li.menuparenth span {
    /* set hover image, left side */
    /*	background:  url(uploads/ngrey/navover.gif) repeat-x left;*/
    Background-color: #ffff00;
    /* change text color on hover */
    	color: #666;
    	font-weight: bold;
    }
    /* IE6 hacks, the JS used for hover effect in IE6 puts class menuh on li, unless they have a class then just an "h" as seen above and below */
    ul#primary-nav li li.menuh {
    	background:  none;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li span {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuparent span {
    /* gif for IE6, as it can't handle transparent png */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    	color: #666
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuh span {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuparenth {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    ul#primary-nav li.menuactive a {
    /* set your image here for active tab right */
    /*	background:  url(uploads/ngrey/navover.gif) repeat-x left;*/
    Background-color: #ffff00;
    }
    ul#primary-nav li a.menuactive span {
    /* set your image here for active tab left */
    /*	background:  url(uploads/ngrey/navover.gif) repeat-x left;*/
    Background-color: #ffff00;
    /* non active is #FFF/white, we need #000/black to contrast with light background */
    	color: #666;
    /* bold to set it off from non active */
    /*	font-weight: bold;*/
    }
    #primary-nav li li a {
    /* second level padding, no image and not as big */
    	padding: 5px 10px;
    /* to keep it within li */
    	width: 165px;
    /* space between them */
    	margin: 5px;
    	background: none;
    }
    /* IE6 hacks to above code */
    * html #primary-nav li li a {
    	padding: 5px 10px;
    	width: 165px;
    	margin: 0px;
    	color: #666;
    }
    #primary-nav li li:hover {
    /* remove image set in first level */
    	background: none;
    }
    #primary-nav li li a:hover {
    /* we need #666 to contrast with dark background */
    	color: #666;
    }
    #primary-nav li.menuparent li a:hover span {
    /* insures text color */
    	color: #000;
    }
     
    ul#primary-nav li:hover li a span {
    /* first level is #FFF/white, we need #666 to contrast with light background */
    	color: #666;
    /* just to insure normal */
    	font-weight: normal;
    }
    #primary-nav li li.menuactive a.menuactive, #primary-nav li li.menuactive a.menuactive:hover {
    /* set your image here, lighter than hover */
    /* non active is #FFF/white, we need #666 to contrast with light background */
    	color: #666;
    }
    #primary-nav li li.menuactive a.menuactive span {
    /* insures text color */
    	color: #666;
    }
     
    #primary-nav li li.menuactive a.menuactive:hover span {
    /* insures text color */
    	color: #000;
    }
     
    /* IE6 hacks to above code */
    #primary-nav li li.menuparenth a.menuparent span {
    /* right arrow for menu parent, IE6 gif */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    	color: #666;
    }
    /* IE6 hacks to above code */
    #primary-nav li li.menuparenth a.menuparent:hover span {
    	color: #666
    }
    #primary-nav li li.menuparent a.menuparent span {
    /* right arrow for parent item */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    }
    #primary-nav li.menuactive li a:hover span {
    /* black text */
    	color: #000
    }
    ul#primary-nav li li a.menuactive  span {
    /* remove image set in first level */
    	background:  none;
    	font-weight: normal;
    }
    #primary-nav li.menuactive li a {
    /* second level active link color */
    	color: #666;
    	text-decoration: none;
    	background: none;
    }
    #primary-nav li.menuactive li a:hover span {
    /* black text */
    	color: #000;
    }
    ul#primary-nav li:hover li a span, ul#primary-nav li.menuparenth li a span {
    	padding: 0px;
    	background:  none;
    }
     
     
    /* The magic - set to work for up to a 3 level menu, but can be increased unlimited, for fourth level add
    #primary-nav li:hover ul ul ul,
    #primary-nav li.menuparenth ul ul ul,
    */
    #primary-nav ul,
    #primary-nav li:hover ul,
    #primary-nav li:hover ul ul,
    #primary-nav li.menuparenth ul,
    #primary-nav li.menuparenth ul ul {
    	display: none;
    }
    /* for fourth level add
    #primary-nav ul ul ul li:hover ul,
    #primary-nav ul ul ul li.menuparenth ul,
    */
    #primary-nav li:hover ul,
    #primary-nav ul li:hover ul,
    #primary-nav ul ul li:hover ul,
    #primary-nav li.menuparenth ul,
    #primary-nav ul li.menuparenth ul,
    #primary-nav ul ul li.menuparenth ul {
    	display: block;
    }
    /* IE Hacks */
    #primary-nav li li {
    	float: left;
    	clear: both;
    }
    #primary-nav li li a {
    	height: 1%;
    }
    Ca va paraître évident pour certains, mais je débute...!

    Merci d'avance pour votre aide

  2. #2
    Rédacteur
    Avatar de Macmillenium
    Homme Profil pro
    Développeur front-end
    Inscrit en
    Mars 2008
    Messages
    2 333
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur front-end
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Mars 2008
    Messages : 2 333
    Points : 3 747
    Points
    3 747
    Par défaut
    Bonjour,

    Le problème vient du positionnement absolute qui s'applique à tous les descendants, je te propose de créer une nouvelle règle dans laquelle tu remets la valeur initiale de position :
    Code css : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    #primary-nav ul.static  {
    	position:static;
    }

    Et affecter la classe .static à tes sous menus :
    Code xhtml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    			<li class="menuparent"><a class="menuparent" href="#"><span>UCI world rankings</span></a>
    				<ul class="unli static">
    					<li><a href="#"><span>Individual</span></a></li>
    
    					<li><a href="#"><span>Teams</span></a></li>
    					<li><a href="#"><span>Nations</span></a></li>
    				</ul>
    			</li>

    etc.
    Je ne réponds pas aux questions techniques par MP.

  3. #3
    Membre régulier
    Inscrit en
    Octobre 2008
    Messages
    329
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 329
    Points : 97
    Points
    97
    Par défaut Pas mal
    Merci de ton aide c'est sympa...!

    C'est bien, mais ce n'est pas exactement ce que je voulais obtenir.

    Maintenant les sous sous-menu se déploient au passage de la souris et se referment si on n'est plus dessus.

    J'aurais voulu que toutes les options soient apparentes et fixes quand on va dans le sous-menu, comme sur la photo.

    En tout cas l'effet est pas mal, je ne connaissais pas "position: static;"

  4. #4
    Membre régulier
    Inscrit en
    Octobre 2008
    Messages
    329
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 329
    Points : 97
    Points
    97
    Par défaut On avance...
    Pour que les sous sous-menu soient toujours visibles, j'ai supprimé les lignes suivantes dans le css :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    /* The magic - set to work for up to a 3 level menu, but can be increased unlimited, for fourth level add
    #primary-nav li:hover ul ul ul,
    #primary-nav li.menuparenth ul ul ul,
    */
    #primary-nav ul,
    #primary-nav li:hover ul,
    #primary-nav li:hover ul ul,
    #primary-nav li.menuparenth ul,
    #primary-nav li.menuparenth ul ul {
    	display: none;
    }
    J'essaie maintenant de réduire les espaces entourés en rouge sur la photo, sans succès...


    Je remets le css qui a pas mal bougé depuis...!
    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
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    @charset "utf-8";
    /* CSS Document */
    #menu_vert {
    /* no margin/padding so it fills the whole div */
    	margin: 0;
    	padding: 0;
        outline: none;
    }
    .clearb {
    /* needed for some browsers */
    	clear: both;
    }
    #menuwrapper {
    /* set the background color for the menu here */
    	background-color: #fff;
    /* IE6 Hack */
    	height: 1%;
    	width: auto;
    	margin-top: 0px;
    	padding: 0;
    }
     
    ul#primary-nav {
    	list-style-type: none;
    	margin: 0px;
    	padding-top: 0px;
    	padding-left: 80px;
    }
     
    #primary-nav ul {
    /* remove any default bullets */
    	list-style-type: none;
    /* sets width of second level ul to background image */
    	width: 210px;
    	margin: 0px;
    	padding: 0px;
    /* make the ul stay in place so when we hover it lets the drops go over the content instead of displacing it */
    	position: absolute;
    /* Pour que le sous-menu ne soit pas caché par le slideshow */
    z-index: 10;
    /* top being the bottom of the li it comes out of */
    	top: auto;
    /* keeps it hidden till hover event */
    	display: none;
    /* room at top for li so image top shows correct */
    	padding-top: 9px;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav ul {
    	padding-top: 13px;
    }
    #primary-nav ul ul {
    	position:static;
    /* insures no top margins */
    	margin-top: 0px;
    /* pulls the last ul back over the preceding ul */
    	margin-left: -1px;
    /* negative margin pulls the left centered in li next to it */
    	top: -3px;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav ul ul {
    	margin-top: 0px;
    	padding-left: 5px;
    	top: -7px;
    }
    #primary-nav li {
    /* a little space to the left of each top level menu item */
    	/*margin-left: 5px;*/
    margin-left: 0px;
    /* floating left will set menu items to line up left to right else they will stack top to bottom */
    	float: left;
    }
    #primary-nav li li {
    /* a little more space to the left of each menu item */
    	margin-left: 8px;
    /* keeps them tight to the one above, no missed hovers */
    	margin-top: -1px;
    /* removes the left float set in first li so these will stack from top down */
    	float: none;
    /* relative to the ul they are in */
    	position: relative;
    }
    /* IE6 hacks on the above code */
    * html #primary-nav li li {
    	margin-left: 6px;
    /* helps hold it inside the ul */
    	width: 171px;
    }
    ul#primary-nav li a {
    /* specific font size, this could be larger or smaller than default font size */
    	font-size: 1em;
    /* make sure we keep the font normal */
    	font-weight: normal;
    /* set default link colors */
    	color: #666;
    /* doing tab menus require a bit different padding, this will give room on right for image to show, adjust to width of your image */
    	padding: 0px 11px 0px 0px;
    /* makes it hold a shape */
    	display: block;
    /* remove default "a" underline */
    	text-decoration: none;
    }
    ul#primary-nav li a span {
    /* takes normal "a" padding minus some for right image */
    	padding: 12px 4px 12px 15px;
    /* makes it hold a shape */
    	display: block;
    }
    ul#primary-nav li a:hover {
    /* kind of obvious */
    	background-color: transparent;
    }
    ul#primary-nav li span {
    /* set text color here also to insure color */
    	color: #666;
    /* just to be sure */
    	font-weight: bold;
    }
    ul#primary-nav li li {
    /* remove any image set in first level li */
    	background:  none;
    }
    ul#primary-nav li li span {
    /* remove any image set in first level li span */
    	background:  none;
    /* set text color here also to insure color */
    	color: #666;
    /* just to be sure */
    	font-weight: normal;
    }
    ul#primary-nav li:hover,
    ul#primary-nav li.menuh,
    ul#primary-nav li.menuparenth {
    Background-color: #ffff00;
    }
    ul#primary-nav li:hover span,
    ul#primary-nav li.menuh span,
    ul#primary-nav li.menuparenth span {
    Background-color: #ffff00;
    /* change text color on hover */
    	color: #666;
    	font-weight: bold;
    }
    /* IE6 hacks, the JS used for hover effect in IE6 puts class menuh on li, unless they have a class then just an "h" as seen above and below */
    ul#primary-nav li li.menuh {
    	background:  none;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li span {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuparent span {
    /* gif for IE6, as it can't handle transparent png */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    	color: #666
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuh span {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    /* IE6 hacks */
    ul#primary-nav li.menuparenth li.menuparenth {
    	background:  none;
    	color: #666;
    	font-weight: normal;
    }
    ul#primary-nav li.menuactive a {
    Background-color: #ffff00;
    }
    ul#primary-nav li a.menuactive span {
    Background-color: #ffff00;
    /* non active is #FFF/white, we need #000/black to contrast with light background */
    	color: #666;
    /* bold to set it off from non active */
    /*	font-weight: bold;*/
    }
    #primary-nav li li a {
    /* second level padding, no image and not as big */
    /*	padding: 5px 10px;*/
        padding: 0px;
     
    /* to keep it within li */
    	width: 165px;
    /* space between them */
    	margin: 5px;
    	background: none;
    }
    /* IE6 hacks to above code */
    * html #primary-nav li li a {
    /*	padding: 5px 10px;*/
    	padding: 0px;
    	width: 165px;
    	margin: 0px;
    	color: #666;
    }
    #primary-nav li li:hover {
    /* remove image set in first level */
    	background: none;
    }
    #primary-nav li li a:hover {
    /* we need #666 to contrast with dark background */
    	color: #666;
    }
    #primary-nav li.menuparent li a:hover span {
    /* insures text color */
    	color: #000;
    }
     
    ul#primary-nav li:hover li a span {
    /* first level is #FFF/white, we need #666 to contrast with light background */
    	color: #666;
    /* just to insure normal */
    	font-weight: normal;
    }
    #primary-nav li li.menuactive a.menuactive, #primary-nav li li.menuactive a.menuactive:hover {
    /* set your image here, lighter than hover */
    /* non active is #FFF/white, we need #666 to contrast with light background */
    	color: #666;
    }
    #primary-nav li li.menuactive a.menuactive span {
    /* insures text color */
    	color: #666;
    }
     
    #primary-nav li li.menuactive a.menuactive:hover span {
    /* insures text color */
    	color: #000;
    }
     
    /* IE6 hacks to above code */
    #primary-nav li li.menuparenth a.menuparent span {
    /* right arrow for menu parent, IE6 gif */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    	color: #666;
    }
    /* IE6 hacks to above code */
    #primary-nav li li.menuparenth a.menuparent:hover span {
    	color: #666
    }
    #primary-nav li li.menuparent a.menuparent span {
    	font-weight: bold;
    /* right arrow for parent item */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    }
    #primary-nav li.menuactive li a:hover span {
    /* black text */
    	color: #000;
    }
    ul#primary-nav li li a.menuactive  span {
    /* remove image set in first level */
    	background:  none;
    	font-weight: normal;
    }
    #primary-nav li.menuactive li a {
    /* second level active link color */
    	color: #666;
    	text-decoration: none;
    	background: none;
    }
    #primary-nav li.menuactive li a:hover span {
    /* black text */
    	color: #000;
    }
    ul#primary-nav li:hover li a span, ul#primary-nav li.menuparenth li a span {
    	padding: 0px;
    	background:  none;
    }
    /* for fourth level add
    #primary-nav ul ul ul li:hover ul,
    #primary-nav ul ul ul li.menuparenth ul,
    */
    #primary-nav li:hover ul,
    #primary-nav ul li:hover ul,
    #primary-nav ul ul li:hover ul,
    #primary-nav li.menuparenth ul,
    #primary-nav ul li.menuparenth ul,
    #primary-nav ul ul li.menuparenth ul {
    	display: block;
    }
    /* IE Hacks */
    #primary-nav li li {
    	float: left;
    	clear: both;
    }
    #primary-nav li li a {
    	height: 1%;
    }
    Merci de votre aide

  5. #5
    Membre régulier
    Inscrit en
    Octobre 2008
    Messages
    329
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 329
    Points : 97
    Points
    97
    Par défaut Supprimer l'espace
    Pour supprimer les espaces il faut ajouter un "float: left;" à cette classe :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    #primary-nav li li.menuparent a.menuparent span {
    	float: left;
    	font-weight: bold;
    /* right arrow for parent item */
    /*	background:  url(uploads/ngrey/parent.gif) no-repeat right center;*/
    }

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

Discussions similaires

  1. Réponses: 3
    Dernier message: 06/01/2014, 21h01
  2. [Joomla!] Affichage du sous menu dans une position différente
    Par frycrash dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 0
    Dernier message: 09/03/2010, 11h32
  3. Créer un sous menu dans menu !
    Par samuelinux dans le forum GTK+ avec C & C++
    Réponses: 4
    Dernier message: 01/02/2008, 19h43
  4. [Firebird]position sous-chaine dans chaine
    Par rahan15 dans le forum SQL
    Réponses: 4
    Dernier message: 10/09/2005, 12h14

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