我試過一切,當涉及到在頁面中間我的CSS菜單居中。居中我的CSS菜單
你可以看到在www.eyewitnesssurveillance.com的CSS菜單
有人可以幫我在頁面上居中這個菜單?謝謝!
這裏是我使用的CSS代碼:你可以做中心
.top-menu-wrap {
margin: 40px 0px 0 0px;
padding: 0;
z-index: 1;
position: relative;
margin: auto;
}
.top-menu-center {
position: center;
text-align: center;
}
.menu-toggle {
width:40px;
height:40px;
text-indent:-99999px;
cursor:pointer;
position:absolute;
opacity:1;
top:0px;
right:15px;
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
transition: all 0.2s ease;
}
.menu-toggle:hover {
opacity:1;
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
transition: all 0.2s ease;
}
.menu-toggle-off {
background: url(../../images/menu/menu_toggle.png) 0 top;}
.menu-toggle-on {
background: url(../../images/menu/menu_toggle.png) 0 bottom;}
.homemenu {
font-family: 'Open Sans', sans-serif;
text-transform: uppercase;
padding: 0;
margin: 0;
height: 85px;
background: url(../../images/gradients/white_to_fade.png) repeat-y right top;
overflow:hidden;
}
.homemenu a { color:#666; text-decoration:none;}
.homemenu ul li {
background:#fff;
background: rgba(255,255,255,0.7);
overflow:hidden;
}
你可以將.homemenu設置爲靜態寬度嗎? – origin1tech
如果您包含HTML,會很有幫助。 – ZZPLKF
同意 - 沒有html就不可能提供幫助 - 你的.top-menu-center類的位置設置爲居中,但這是無效的,也許這就是你的問題 – crdunst