首先是代码:
#menu {
padding:0;
margin-top:0px;
position:absolute;
top:0px;
width:100%;
float:left;
overflow:hidden;
}
#menu li {
list-style:none;
float: left;
position: relative;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;
border:1px solid black;
background-image: linear-gradient(#F2FF00, #AEFF00);
margin-left:10px;
}
#menu a {
display:block;
padding:auto;
text-align:center;
padding:10px 10px;
color: #0095FF;
text-transform: uppercase;
font: bold 25px Arial, Helvetica;
text-decoration: none;
text-shadow: 1px 1px 2px #0095FF;
}
当我缩小窗口时,按钮会向下移动。如果可以将高度设置为菜单使其不会改变,但按钮仍然超出菜单元素,为什么会发生这种情况?
这里是 jsFiddle:http: //jsfiddle.net/nqdXc/