How to create a triangle in CSS3 using border-radius

后端 未结 7 1910
攒了一身酷
攒了一身酷 2020-11-30 11:39

I am using border-radius property to acheive rounded corners. But I am not sure how to get rounded corners of this shape. I tried giving same dimensions from either sides bu

7条回答
  •  长情又很酷
    2020-11-30 12:09

    If I have understood your question properly. I think you can use something like below:

    CSS:

    #box{   border-color: transparent transparent transparent #FFFFFF;
        border-style: solid;
        border-width: 50px 0 50px 75px;
        height: 0;
        left: -40px;
        margin: 40px;
        position: absolute;
        width: 0;
    }
     #outerbox{  background:red;
        height: 300px;
        position: relative;
        width: 122px;
    }
    

    HTML

    LIVE DEMO

    http://jsfiddle.net/fsGQR//

提交回复
热议问题