centrage d'un menu horizontal déroulant |
|
Voir le sujet précédent :: Voir le sujet suivant |
Auteur |
Message |
Cyborg69 html mioche
|
centrage d'un menu horizontal déroulant , Posté le: 11-10-2004 20:24 |
|
|
Bon voila, je suis en train de faire un menu horizontal deroulant genre http://www.alsacreations.com/articles/modelesmenus/hd1.htm [http://www.alsacreations.com/articles/modelesmenus/hd1.htm]
Je voudrai bien centrer ce menu sur la largeur mais je ne trouve pas ce qu'il faut mettre (et où) pour que ca marche.
Voici pour l'instant ma feuille de style :
Code: |
<!--
body {
margin: 10px;
padding: 0;
h1 {font-size:24pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
h2 {font-size:19pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
h3 {font-size:13pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
h4 {font-size:11pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
h5 {font-size:9pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
h6 {font-size:7pt; font-weight: regular; font-family: "MS Reference Sans Serif", Arial, Helvetica, "Book Antiqua" margin:0px;}
}
dl.gal, dt.gal, dd.gal, ul.gal, li.gal {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
position: absolute;
top: 180;
lef_t: 215;
z-index:100;
width: 100%;
}
#menu dl.gal {
float: left;
width: 13em;
}
#menu dt.gal {
cursor: pointer;
text-align: center;
background: #ccc;
border: 1px solid gray;
margin: 1px;
}
#menu dd.gal {
display: none;
border: 1px solid gray;
}
#menu li.gal {
text-align: center;
background: #fff;
}
#menu li.gal a, #menu dt.gal a {
color: #000;
text-decoration: none;
display: block;
height: 100%;
border: 0 none;
}
#menu li.gal a:hover, #menu li.gal a:focus, #menu dt.gal a:hover, #menu dt.gal a:focus {
background: #eee;
}
#site {
position: absolute;
z-index: 1;
top : 70px;
left : 10px;
color: #000;
background-color: #ddd;
padding: 5px;
border: 1px solid gray;
}
--> |
Au passage : j'ai mis mes polices en regular mais les textes sont quand meme affichés en gras
ké ki ce passe ? |
|
|
SIBELIUS html mioche
|
centrage d'un menu horizontal déroulant , Posté le: 11-10-2004 22:09 |
|
|
Ton menu est en position absolute avec des valeurs fixes par rapports aux coins haut et gauche :
#menu {
position: absolute;
top: 180;
lef_t: 215; --> Attention, cette propriété n'existe pas !
z-index:100;
width: 100%;
}
Pour centrer le menu : http://www.alsacreations.com/articles/centrer/ |
|
|
Cyborg69 html mioche
|
centrage d'un menu horizontal déroulant , Posté le: 12-10-2004 17:55 |
|
|
SIBELIUS a écrit: |
lef_t: 215; --> Attention, cette propriété n'existe pas !
|
Oui en fait j'avai mis left: 215; mais comme je voulais tester le centrage, au lieu d'effacer, j'ai eronné la propriété exprès
Merci pour le lien, j'ai fait mon menu à l'aide des marges négatives |
|
|
Cyborg69 html mioche
|
centrage d'un menu horizontal déroulant , Posté le: 12-10-2004 18:01 |
|
|
par contre j'ai toujours pas compris pourquoi mon texte est en gras alors que j'ai mis :
Code: |
font-weight: regular; |
pouquoi ca me fait comme ca ? |
|
|
|
|
Accueil Forum
-> css |
Toutes les heures sont au format GMT + 1 Heure
|
Page 1 sur 1 |
|
S'enregistrer
Profil
Se connecter pour vérifier ses messages privés
Rechercher
Membres
FAQ
Connexion
|