我设置了用于导航的圆角面包屑。如何删除左侧和右侧的背景,如下图所示。删除圆角面包屑的左右背景颜色
.tabs {
overflow: hidden;
background: #eee;
}
.tabs a {
color: #363c46;
float: left;
width: 135px;
text-align: center;
line-height: 50px;
text-decoration: none;
}
.tabs a.active {
background: #fefb09;
border-radius: 30px;
}
.tabs a:first-child {
border-top-left-radius: 30px;
border-bottom-left-radius: 30px;
}
.tabs a:last-child {
border-top-right-radius: 30px;
border-bottom-right-radius: 30px;
background: #d1d1d1;
/* to render the right end look */
}
<div class="tabs">
<a class="active">Item 1</a>
<a>Item 2</a>
<a>Item 3</a>
<a>Item 4</a>
<a>Item 5 </a>
</div>
使用...伪元素的第一个孩子和最后一个孩子。 –