How to make angled tab like this using css?

后端 未结 5 2160
梦如初夏
梦如初夏 2020-12-15 19:49

I need to make like this. Is it possible with pure css?

\"enter

5条回答
  •  太阳男子
    2020-12-15 20:23

    Here is the window typed tab buttons with css

    .tablist{
        padding:0;
        margin:0;
        list-style:none;
        display:flex;
        justify-content:center;
    }
    .tablist>li{
    }
    .tablist >li>a{
        position: relative;
        display: block;
        color: red;
        text-decoration: none;
        line-height: 1.4;
        border-top: 1px solid red;
        border-radius: 6px 6px 0 0;
        padding: 3px 10px;
        margin: 0 5px;
    }
    .tablist >li>a:before{
        position: absolute;
        content: "";
        width: 9px;
        height: 29px;
        background: white;
        transform: rotate(21deg);
        border-left: 1px solid red;
        left: -5px;
        top: 2px;
        z-index: -1;
        border-radius: 2px 0 0 0px;
    
    }
    .tablist >li>a:after{
        position: absolute;
        content: "";
        width: 9px;
        height: 29px;
        background: white;
        transform: rotate(-21deg);
        border-right: 1px solid red;
        right: -5px;
        top: 2px;
        z-index: -1;
        border-radius: 2px 0 0 0px;
    
    }
    

    And the html will be like this

    
    

提交回复
热议问题