Centrer menu horizontal
lizard
-
Julien -
Julien -
Bonjour,
je cherche à savoir quelle ligne de mon CSS modifier pour reussir à centrer ce p..!?! de menu horizontal, et apparemment ce qui marche pour les autres ne marche pas pour moi.
voici mon css
le site en question lasoucherock.fr, d'ailleurs tant que j'y suis, savez vous pourquoi le logo en haut à gauche apparait parfaitement sur firefox et pixeilé sur IE ?
Merci d'avance.
je cherche à savoir quelle ligne de mon CSS modifier pour reussir à centrer ce p..!?! de menu horizontal, et apparemment ce qui marche pour les autres ne marche pas pour moi.
voici mon css
.topleftcorner {
}
.topshadowleft { height:30px; background-image: url(../images/topdropshadowleft.jpg) }
.topshadow { height:30px; background-image: url(../images/topdropshadow.jpg) }
.topshadowright { height:30px; background-image: url(../images/topdropshadowright.jpg) }
.toprightcorner { }
.topleftdrop { }
.topblackgardient {
height:200px;
background-image: url(../images/topcrowd.jpg);
background-repeat: no-repeat;
background-position: center;
background-color: #000000;
}
.toprightdrop {}
.bluegardientleft { }
.bluegardientbg { height:33px; background-image: url(../images/bluegardientbg.jpg) }
.bluegardientright { }
.leftdropshadow20 { }
.bluegardientlowerleft { height:00px; background-image: url(../images/bluegardientdropshadowlowerleft.jpg) }
.bluegardientmiddl { height:20px; background-image: url(../images/bluegardientdropshadowmiddl.jpg) }
.bluegardientlower { height:20px; background-image: url(../images/bluegardientdropshadowlower.jpg) }
.dropshadowright20 { }
.leftdropshadow {}
.mainbodybg {
background-color:#000000;
}
.dropshadowright {}
.footershadowleft { }
.footershadowright { }
.footerleftlower { }
.footerlowerleft { height:29px; background-image: url(../images/footerlowerleft.jpg); }
.footerlower { height:29px; background-image: url(../images/footerlower.jpg); }
.footerlowerright { height:29px; background-image: url(../images/footerlowerright.jpg); }
.footerrightlower { }
.banneritem {text-align:center;}
.readon {
border-bottom:1px dotted black;
border-left:1px dotted black;
}
td {font-size:12px;}
a:link, a:visited, h3, .contentheading,.blog_more div strong {
color:white;
}
.introtext, .fulltext {
color:#FFFFFF;
}
div {
margin:0;
}
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
color:white;
line-height:175%;
text-align:justify;
height:100%;
font-size: 12px;
margin:0px;
padding:0px;
background-repeat:no-repeat;
}
h1,h2,h3,h4,h5,h6 {
color:white;
margin:0;
padding:0;
}
ul {
margin:0;
padding:0;
}
a {
text-decoration:none;
font-weight:bold;
}
ul li a, .pagenavcounter {
font-weight:bold;
}
ul#mainlevel-nav {
margin:0 auto;
padding:0;
height:33px;
}
ul#mainlevel-nav li {
list-style: none;
display:inline;
height:33px;
width:119px;
}
ul#mainlevel-nav li a {
font-size:15px;
color:white;
font-weight:bold;
text-align:center;
background:url(../images/buttontop_normal.jpg) no-repeat;
line-height:33px;
height:33px;
width:122px;
display: inline-block;
float:left;
}
ul#mainlevel-nav li a:hover {
color:white;
font-size:15px;
font-weight:bold;
text-align:center;
background:url(../images/buttontop_over.jpg) no-repeat;
line-height:33px;
height:33px;
width:122px;
float:left;
}
h3 {
margin-bottom:10px;
}
.contentheading, .blog_more div strong {
font-weight:bold;
}
.blog_more a {
font-weight:normal;
color:black;
}
.componentheading {
color:black;
padding-bottom:10px;
margin-bottom:20px;
}
.menu , .menu ul
{
list-style-type:none;
}
.vistaleft a.mainlevel:link, .vistaleft a.mainlevel:visited ,.vistaleft .menu li a:link,.vistaleft .menu li a:visited{
color:#FFFFFF;
font-size:12px;
display:block;
margin-left:-5px;
padding-left:20px;
line-height:34px;
height:42px;
background:url(../images/button_normal.jpg) no-repeat;
font-weight:normal;
}
.vistaleft a.mainlevel:hover,.vistaleft .menu li a:hover {
background:url(../images/button_over.jpg) no-repeat;
}
.vistaleft a.mainlevel#active_menu:link, .vistaleft a.mainlevel#active_menu:hover, .vistaleft a.mainlevel#active_menu:visited,.vistaleft .menu li#current a:link,.vistaleft .menu li#current a:hover,.vistaleft .menu li#current a:visited {
color:white;
font-size:12px;
display:block;
margin-left:-5px;
padding-left:20px;
line-height:34px;
height:42px;
background:url(../images/button_activated.jpg) no-repeat;
font-weight:normal;
}
.vistaright a.mainlevel:link, .vistaright a.mainlevel:visited,.vistaright .menu li a:link,.vistaright .menu li a:visited {
color:white;
margin-right:-5px;
text-align:right;
font-size:12px;
display:block;
padding-right:20px;
line-height:34px;
height:42px;
background:url(../images/buttonright_normal.jpg) no-repeat;
background-position:center;
font-weight:normal;
}
.vistaright a.mainlevel:hover,.vistaright .menu li a:hover {
background:url(../images/buttonright_over.jpg) no-repeat;
background-position:top right;
}
.vistaright a.mainlevel#active_menu:link, .vistaright a.mainlevel#active_menu:hover, .vistaright a.mainlevel#active_menu:visited,.vistaright .menu li#current a:link,.vistaright .menu li#current a:hover,.vistaright .menu li#current a:visited {
color:white;
text-align:right;
margin-right:-5px;
font-size:12px;
display:block;
padding-right:20px;
line-height:34px;
height:42px;
background:url(../images/buttonright_activated.jpg) no-repeat;
background-position:top right;
font-weight:normal;
}
.vistaleft a.sublevel:link, .module a.sublevel:visited, .vistaleft .menu li#current li a:link, .vistaleft .menu li#current li a:visited {
color:white;
margin-left:-5px;
font-size:12px;
display:block;
padding-left:20px;
line-height:34px;
height:42px;
background:url(../images/button_subnormal.jpg) no-repeat;
font-weight:normal;
}
.vistaleft a.sublevel:hover, .vistaleft .menu li#current li a:hover{
background:url(../images/button_subover.jpg) no-repeat;
}
a.vistaleft .sublevel#active_menu:link, .vistaleft a.sublevel#active_menu:hover, .vistaleft a.sublevel#active_menu:visited,.vistaleft .menu li li#current a:link ,.vistaleft .menu li li#current a:visited ,.vistaleft .menu li li#current a:hover {
color:white;
font-size:12px;
margin-left:-5px;
display:block;
padding-left:20px;
line-height:34px;
height:42px;
background:url(../images/button_subactivated.jpg) no-repeat;
font-weight:normal;
}
.vistaright a.sublevel:link, .vistaright a.sublevel:visited, .vistaright .menu li#current li a:link, .vistaright .menu li#current li a:visited {
color:white;
text-align:right;
margin-right:-5px;
font-size:12px;
display:block;
padding-right:20px;
line-height:34px;
height:42px;
background:url(../images/buttonright_subnormal.jpg) no-repeat;
background-position:top right;
font-weight:normal;
}
.vistaright a.sublevel:hover, .vistaright .menu li#current li a:hover {
background:url(../images/buttonright_subover.jpg) no-repeat;
background-position:top right;
}
.vistaright a.sublevel#active_menu:link, .vistaright a.sublevel#active_menu:hover, .vistaright a.sublevel#active_menu:visited,.vistaright .menu li li#current a:link ,.vistaright .menu li li#current a:visited ,.vistaright .menu li li#current a:hover {
color:white;
text-align:right;
margin-right:-5px;
font-size:12px;
display:block;
padding-right:20px;
line-height:34px;
height:42px;
background:url(../images/buttonright_subactivated.jpg) no-repeat;
background-position:top right;
font-weight:normal;
}
.vistaleft {
padding:5px;
background-color: #000000;
color: #FFFFFF;
}
.vistamain {padding:5px;overflow:auto;}
.vistaright {text-align:center;padding:5px;}
.vistafooter {color:white;font-size:11px;background:url(../images/footer.jpg) repeat-x #000;}
.vistafooter a:link, .vistafooter a:visited {font-weight:bold;color:gray;font-size:11px;}
.module {
margin:0;
padding-bottom:10px;
color:#FFFFFF;
}
.moduletable {
line-height:175%;
margin:0;
padding-bottom:20px;
}
.moduletable td {
padding-left:5px;
padding-right:5px;
}
.vistaleft .module h3, .vistaleft .module_menu h3 {
padding-left:25px;
margin:-5px 0 0 -5px;
color:white;
line-height:34px;
height:43px;
font-size:14px;
background:url(../images/titlebuttonleft.jpg) no-repeat;
}
.vistaright .module h3, .vistaright .module_menu h3 {
margin:-5px;
padding-right:25px;
text-align:right;
color:white;
line-height:34px;
height:43px;
font-size:14px;
background:url(../images/titlebuttonright.png) no-repeat;
background-position:top right;
}
.small {
color:#666666;
}
.createdate, .modifydate {
color:#999999;
}
#mod_login_username, #mod_login_password {
width:150px;
background-color:#FFFFFF;
border:1px solid #CCCCCC;
padding:2px;
color:black;
}
.inputbox {
background-color:#FFFFFF;
border:1px solid #CCCCCC;
padding:2px;
color:black;
}
.readon {
padding-left:5px;
}
.contenttoc {
margin:10px;
border:1px solid #CCCCCC;
}
.contenttoc td {
text-align:left;
padding-left:5px;
padding-right:5px;
}
.contenttoc th {
text-align:left;
background-color:#DEDEDE;
padding-left:5px;
padding-right:5px;
}
.label {
text-align:left;
}
.mosimage {
border:1px solid #CCCCCC;
margin:5px;
}
.mosimage_caption {
background-color:#DEDEDE;
}
.sectiontableheader {
font-weight: bold;
}
.sectiontableentry2 label {
text-align:left;
}
.sectiontableentry2 {
background-color:#FFFFFF;
}
.sectiontableentry1 {
background-color:#F5F5F5;
}
.sectiontableentry1 td div a, .sectiontableentry2 td div a {
font-weight:bold;
border:none;
}
.div_bfree {
visibility:hidden;
overflow:hidden;
height:0px;
}
h3, .contentheading {
/*font-size:140%;*/
color:white;
font-size:14px;
font-weight:bold;
margin:0px;
}
.componentheading {
/*font-size:160%;*/
color:white;
font-size:14px;
font-weight:bold;
letter-spacing: 2px;
text-transform:uppercase;
}
img {
border:0px;
}
.contentpane
{color:black;}
.contentpaneopen {
line-height:140%;
color:black;
width:100%;
}
.vistauser1, .vistauser2 {
margin:2px;
color:black;
}
/* The following code is taken from rhuk - template: rhuk_solarflare_ii. */
.button {
color: black;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-align: center;
font-size: 11px;
font-weight: bold;
border: 1px dotted #000;
background:none;
width: auto;
padding: 0px 4px;
line-height: 16px !important;
line-height: 14px;
height: 24px !important;
height: 22px;
margin: 1px;
}
.back_button {
color: black;
font-family: Arial, Hevlvetica, sans-serif;
text-align: center;
font-size: 11px;
font-weight: bold;
border: 3px double #cccccc;
background:none;
width: 50px;
padding: 0px 5px;
line-height: 18px !important;
line-height: 16px;
height: 19px !important;
height: 19px;
margin: 1px;
}
.pagenav_next {
color: black;
font-family: Arial, Hevlvetica, sans-serif;
text-align: center;
font-size: 11px;
font-weight: bold;
border: 3px double #cccccc;
background:none;
width: 50px;
padding: 0px 5px;
line-height: 18px !important;
line-height: 16px;
height: 19px !important;
height: 19px;
margin: 1px;
}
.pagenav_prev {
color: black;
font-family: Arial, Hevlvetica, sans-serif;
text-align: center;
font-size: 11px;
font-weight: bold;
border: 3px double #cccccc;
background:none;
width: 50px;
padding: 0px 5px;
line-height: 18px !important;
line-height: 16px;
height: 19px !important;
height: 19px;
margin: 1px;
}
.pagenav {
text-align: center;
font-size: 11px;
font-weight: bold;
border-left: 1px dotted #000;
border-bottom: 1px dotted #000;
background:none;
width: auto;
padding: 0px 10px;
line-height: 20px;
margin: 1px;
}
.pagenavbar {
margin-right: 10px;
float: right;
}
fieldset {
border:0px;
}
/* -- form validation */
.invalid { border-color: #ff0000; }
label.invalid { color: #ff0000; }
/* -- buttons */
#editor-xtd-buttons {
padding: 5px;
}
.button2-left,
.button2-right,
.button2-left div,
.button2-right div {
float: left;
}
.button2-left a,
.button2-right a,
.button2-left span,
.button2-right span {
display: block;
height: 22px;
float: left;
line-height: 22px;
font-size: 11px;
color: #666;
cursor: pointer;
}
.button2-left span,
.button2-right span {
cursor: default;
color: #999;
}
.button2-left .page a,
.button2-right .page a,
.button2-left .page span,
.button2-right .page span {
padding: 0 6px;
}
.page span {
color: #000;
font-weight: bold;
}
.button2-left a:hover,
.button2-right a:hover {
text-decoration: none;
color: #0B55C4;
}
.button2-left a,
.button2-left span {
padding: 0 24px 0 6px;
}
.button2-right a,
.button2-right span {
padding: 0 6px 0 24px;
}
.button2-left {
float: left;
margin-left: 5px;
}
.button2-right {
float: left;
margin-left: 5px;
}
/* Tooltips */
.tool-tip {
float: left;
background: #ffc;
border: 1px solid #D4D5AA;
padding: 5px;
}
.tool-title {
padding: 0;
margin: 0;
font-size: 100%;
font-weight: bold;
margin-top: -15px;
padding-top: 15px;
padding-bottom: 5px;
background: url(../../system/images/selector-arrow.png) no-repeat;
}
.tool-text {
font-size: 100%;
margin: 0;
}
/* System Standard Messages */
#system-message { margin-bottom: 20px; }
#system-message dd.message ul { background: #C3D2E5 url(../../system/images/notice-info.png) 4px center no-repeat;}
/* System Error Messages */
#system-message dd.error ul { color: #c00; background: #E6C0C0 url(../../system/images/notice-alert.png) 4px center no-repeat; border-top: 3px solid #DE7A7B; border-bottom: 3px solid #DE7A7B; margin:0px; padding-left: 40px; text-indent:0px;}
/* System Notice Messages */
#system-message dd.notice ul { color: #c00; background: #EFE7B8 url(../../system/images/notice-note.png) 4px center no-repeat; border-top: 3px solid #F0DC7E; border-bottom: 3px solid #F0DC7E;}
#syndicate{
float:left;
padding-left: 25px;
}
#power_by{
float:right;
padding-right: 25px;
}
/* Component Specific Fixes */
#component-contact table td {
padding: 2px 0;
}
/* forms */
table.adminform textarea {
width: 540px;
height: 400px;
font-size: 1em;
color: #000099;
}
/* Frontend Editing*/
fieldset {
border: 1px solid #ccc;
margin-top: 15px;
padding: 15px;
}
legend {
margin: 0;
padding: 0 10px;
}
td.key {
border-bottom:1px solid #eee;
color: #666;
}
@media print{
.vistaleft, .vistauser1user1, .vistaright, .vistatop, .vistauser3, .noprint {display:none;}
.print {width:100%;}
body, .vistamain{background:none;}
}
le site en question lasoucherock.fr, d'ailleurs tant que j'y suis, savez vous pourquoi le logo en haut à gauche apparait parfaitement sur firefox et pixeilé sur IE ?
Merci d'avance.
A voir également:
- Centrer menu horizontal
- Menu déroulant excel - Guide
- Canon quick menu - Télécharger - Utilitaires
- Windows 11 menu démarrer classique - Guide
- Ecran horizontal - Guide
- Windows 11 menu contextuel classique - Guide
3 réponses
Bonjour,
Essaye ça :
Essaye ça :
ul#mainlevel-nav {
margin:0 auto;
padding:0;
height:33px;
text-align:center;
}
lizard
Salut yaninho, merci pour ta contribution mais ça ne resoud pas le problème.
Bon,
Je ne suis pas spécialiste CSS, cela dit, on est au moins sûrs d'une chose, ça se passe ici :
Sinon tu peux essayer de mettre un margin-left sur ton menu, mais ya peut-être plus simple (et plus propre)...
Je ne suis pas spécialiste CSS, cela dit, on est au moins sûrs d'une chose, ça se passe ici :
ul#mainlevel-nav {
margin:0 auto;
padding:0;
height:33px;
}
ul#mainlevel-nav li {
list-style: none;
display:inline;
height:33px;
width:119px;
}
ul#mainlevel-nav li a {
font-size:15px;
color:white;
font-weight:bold;
text-align:center;
background:url(../images/buttontop_normal.jpg) no-repeat;
line-height:33px;
height:33px;
width:122px;
display: inline-block;
float:left;
}
ul#mainlevel-nav li a:hover {
color:white;
font-size:15px;
font-weight:bold;
text-align:center;
background:url(../images/buttontop_over.jpg) no-repeat;
line-height:33px;
height:33px;
width:122px;
float:left;
}
Sinon tu peux essayer de mettre un margin-left sur ton menu, mais ya peut-être plus simple (et plus propre)...