css實(shí)線平行四邊形導(dǎo)航

效果
1638515865(1).png
<div class="per" v-for="(item,index) in navNameList" :key="index" :class="[routeName==item.name?'acNav':'norNav','per'+index]">
              {{item.meta.title}}
          </div>
.per{
            height: 30px;
            padding: 0 20px;
            line-height: 30px;
            cursor: pointer;
            font-size: 14px;
            position: relative;
            left: -6px;
            margin: 0 3px;
        }
.acNav{
            // background-image: url('../../../assets/imgs/nav_bg2.png');
            // background-size: 100% 100%;
            // background-repeat: no-repeat;
            color: #FFCD55;
        }
        .acNav::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-image: linear-gradient(180deg, #224E70 0%, #1C7EAE 100%);
            z-index: -1;
            transform: skew(20deg);
        }
        .norNav{
            // background-image: url('../../../assets/imgs/nav_bg3.png');
            // background-size: 100% 100%;
            // background-repeat: no-repeat;
            color: #EFF5F6;
        }
        .norNav::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-image: linear-gradient(180deg, #103853 0%, #005D8B 100%);
            z-index: -1;
            transform: skew(20deg);
        }
<liclass="out">
<div></div>
</li>
.out{transform: skewX(34deg);}
div{transform: skewX(-34deg);}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容