设置tab标签页 遮挡部分

效果如下:

主要代码:

<div class="need-detail">
    <div class="top-title">
    <span data-index=0 class="curr">搜索<b>×</b></span>
        <span data-index=1>商详<b>×</b></span>
    </div>
    <div class="tab-content"></div>
</div>    

对应的css

.need-detail{
    .top-title{
        height: 39px;/*必须设置高度*/
        span{
            float: left;/*设置浮动,保证层级高于下面的tab切换框*/
            width: 82px;
            height: 38px;
            line-height: 38px;
            border: 1px solid #e5e7ea;
            border-bottom: 0px;
            background: #fff;/*设置白色 这样往下移动的时候覆盖下面颜色*/
        }
        .curr{
            height: 39px;/*高于没有选择的div*/
        }
    }
    .tab-content{
        border: 1px solid #e5e7ea;
        height: 300px;
    }
}
原文地址:https://www.cnblogs.com/xiaozhumaopao/p/7170880.html