我尝试在悬停状态下实现带有额外填充的选项卡栏。 但问题是悬停状态实际上它移动父div。css选项卡栏高度问题
你可以看到下面的html;
<div id="statNav">
<a href="#">Gogus</a>
<a href="#">Kol</a>
<a href="#">Gogus</a>
<a href="#">Gogus</a>
<a href="#">Gogus</a>
<a href="#">Omuz</a>
<a href="#">Gogus</a>
</div>
and css;
#statNav{
width:100%;
border-bottom:2px solid #9B2F2C;
overflow:auto;
}
#statNav a{
float:left;
background-color:#333333;
color:white;
font-size:12px;
font-weight:bold;
text-align:center;
width:62px;
padding-top: 5px;
padding-bottom:5px;
border-right: 1px solid #777777;
}
#statNav a:first-child{
-webkit-border-radius: 5px 0px 0px 0px;
border-radius: 5px 0px 0px 0px;
}
#statNav a:last-child{
-webkit-border-radius: 0px 5px 0px 0px;
border-radius: 0px 5px 0px 0px;
border-right:none;
width:63px;
}
#statNav a:hover{
-webkit-border-radius: 5px 5px 0px 0px;
border-radius: 5px 5px 0px 0px;
background-color:#9B2F2C;
padding-top: 15px;
}
这是工作示例;
我该怎么解决呢?
这是因为您增加了标签的高度。 – 2013-04-01 19:24:39