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?
You can use clip-path
, as Stewartside and Sviatoslav Oleksiv mentioned. To make things easy, I created a sass mixin:
@mixin cut-corners ($left-top, $right-top: 0px, $right-bottom: 0px, $left-bottom: 0px) {
clip-path: polygon($left-top 0%, calc(100% - #{$right-top}) 0%, 100% $right-top, 100% calc(100% - #{$right-bottom}), calc(100% - #{$right-bottom}) 100%, $left-bottom 100%, 0% calc(100% - #{$left-bottom}), 0% $left-top);
}
.cut-corners {
@include cut-corners(10px, 0, 25px, 50px);
}