朝夕ing
2017-01-06 16:21
.main {
width: 598px;
height: 298px;
border: 1px solid #eee;
overflow: hidden;
margin: 10px auto;
}
.main-til {
height: 47px;
position: relative;
}
.main-til ul {
position: absolute;
width: 601px;
left: -1px;
}
.main-til li {
float: left;
width: 117px;
height: 46px;
line-height: 46px;
text-align: center;
overflow: hidden;
background: #F7f7F7;
border-bottom: 1px solid #eee;
padding:0 1px;
}
.main-til li a:link, a:visited {
color: #000;
text-decoration: none;
}
.main-til li a:hover {
color: #F90;
}
.select {
background: #FFFFFF;
border-bottom-color: #FFFFFF;
border-left: 1px solid #eeeeee;
border-right: 1px solid #eeeeee;
padding:0;
font-weight: bold;
}
把li的宽度设为118px就会产生溢出,谁能告诉我怎么设置padding值
这个要精确计算,不能精确的或者可以这样,平分每个li的宽度取不溢出的宽度,看看与总ul的宽度还差多少,对其中一个li独立设置一个class控制其宽度,1~2个像数很难肉眼看出来 。。
或者又可以对 li 设置margin:0 auto;
Tab选项卡切换效果
65460 学习 · 581 问题
相似问题