Cut Corners using CSS

后端 未结 15 1578
悲&欢浪女
悲&欢浪女 2020-11-22 03:34

I\'m looking to \"cut\" the top left corner of a div, like if you had folded the corner of a page down.

I\'d like to do it in pure CSS, are there any methods?

15条回答
  •  离开以前
    2020-11-22 04:08

    by small modification of Joshep's code...You can use this code which seems like right corner folded down as per your requirement.

    div {
        height: 300px;
        background: red;
        position: relative;
    }
    
    div:before {
        content: '';
        position: absolute;
        top: 0; right: 0;
        border-top: 80px solid white;
        border-left: 80px solid blue;
        width: 0;
    }
    

提交回复
热议问题