CSS:圆角tab

 

 

 

.tab .item{position: relative;display: inline-block;padding: .5em 1em .35em;color: white;}
.tab .item::before{content:'';position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index:-1;background: #ccc;
    background-image: linear-gradient(hsla(0,0%,100%,.6),hsla(0,0%,100%,0));
    border: 1px solid rgba(0,0,0,.4);border-bottom: none;border-radius:.5em .5em 0 0;box-shadow: 0 .15em white inset;
    transform: perspective(.5em) rotateX(5deg);transform-origin:bottom left;
}
.content{background: #ccc; border: 1px solid rgba(0,0,0,.4);width:300px;height: 150px;}

 

 

<div class="tab">
  <div class="item">tab1</div>
  <div class="item">tab2</div>
  <div class="item">tab3</div>
</div>
<div class="content"></div>

 

posted @ 2017-06-15 20:59  mudeng007  阅读(580)  评论(0)    收藏  举报