因此它适用于桌面设备,即使我确信我的操作方式是错误的,但它在移动设备上会向左对齐。
我尝试向@media 添加一些代码但无法弄清楚。
我主要搞乱了 right: float: padding:
任何对齐命令都不起作用
@media not all and (min-width: 780px) {
#centeredmenu { max-width: 220px; }
}
#centeredmenu {
clear:both;
min-width: 220px;
}
#centeredmenu ul {
margin:0;
padding:0;
list-style:none;
float:right;
position:relative;
right:50%;
}
#centeredmenu ul li {
margin:1px 0 0 1px;
padding:0;
float: left;
position: relative;
left:50%;
top:11px;
}
#centeredmenu ul li a {
z-index: 999;
display:block;
margin:0;
padding:.4em .2em .4em;
line-height:1em;
background:#ddd;
text-decoration:none;
color:#444;
width: 70px;
font-size: 13px;
font-weight: 100;
text-align: center;
font-family: Proxima Nova; …Run Code Online (Sandbox Code Playgroud)