Home  >  Q&A  >  body text

CSS3 画如下图形

请教一下CSS3怎么画出如下的tab,其中一个的样式即可

大家讲道理大家讲道理2648 days ago517

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 11:53:38

    css

    *,p{
    margin:0;
    padding:0;
    }
        .demo{
            width:100px;
            height:50px;
            border-top:1px solid black;
            margin:200px;
            position: relative;
        }
        .demo::before{
            content: "";
            width: 50px;
            height: 50px;
            border-left: 1px solid black;
            transform: rotate(45deg);
            position: absolute;
            top: 10px;
            left: -25px;
            
        }
        .demo::after{
            content: "";
            width: 50px;
            height: 50px;
            border-top: 1px solid black;
            transform: rotate(45deg);
            position: absolute;
            top: 10px;
            right: -25px;        
        }
    
    

    html

    <p class="demo"></p>

    reply
    0
  • 阿神

    阿神2017-04-17 11:53:38

    .trapezoid-1 {

            height: 0;
            width: 100px;
            border-bottom: 100px solid #e5c3b2;
            border-left: 60px solid transparent;
            border-right: 60px solid transparent;
        }
    

    reply
    0
  • Cancelreply