这是我在页面中使用的代码:
<ul class="tabs">
<li style="border-left:1px solid #006699;">
<input type="radio" name="tab1" id="som" value="0">
<label for="som">Venta</label>
</li>
<li>
<input type="radio" name="tab1" id="som1" value="1">
<label for="som1">Aliquera</label>
</li>
<li>
<a href="http://www.google.com">
<label for="tab3">YO Busco</label>
</a>
</li>
</ul>
css
.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 95%;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 0px auto;
}
.tabs li{
float: left;
border:1px solid #006699;
border-left:none;
border-radius:10px 10px 0 0;
border-bottom:none;
width:31%;
background-color:#EDF6FA;
}
.tabs label {
display: block;
padding: 10px 10px;
border-radius: 10px 10px 0 0;
color: #08C;
cursor: pointer;
position: relative;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
[id]:checked + label {
background: #006699;
color: #ffffff;
}
我在这里有两个问题:
请有人帮助我解决这个问题。js fiddle链接是http://jsfiddle.net/ec8Hq/。1.如果我们仔细看选项卡,我们会发现圆角边框颜色比边框颜色浅。我不知道为什么会这样。我希望它与边框颜色相同。
2.当我们单击其中一个选项卡时,它会更改颜色。但是如果我们仔细观察,可以看到边框半径和背景颜色之间存在间隙。