码迷,mamicode.com
首页 > Web开发 > 详细

tab css 切换效果

时间:2020-01-13 18:05:44      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:code   isp   index   tabs   ott   ati   order   lex   for   

<div class="tabs-list">
      <div class="tabs-content">
        <div v-for="(item,index) in test" :key="index" @click="txt(index)" :class="current === index?‘active‘:‘‘">{{item}}</div>
      </div>
 </div>
.tabs-content {
    display: flex;
    div{
      position: relative;
      margin: 0 20px;
      line-height: 40px;
    }
    div::before{
      content: "";
      position: absolute;
      bottom: 0;
      left: 100%;
      width: 0;
      height: 100%;
      border-bottom: 2px solid blue;
      transition: 0.1s all linear;
    }
    div.active{
      color: blue;
    }
    div.active::before{
      width: 100%;
      left: 0;
    }
    div.active ~ div::before{
      left: 0;
    }
  }

tab css 切换效果

标签:code   isp   index   tabs   ott   ati   order   lex   for   

原文地址:https://www.cnblogs.com/Blogzlj/p/12188218.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!