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 could use linear-gradient
. Let's say the parent div
had a background image, and you needed a div
to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:
.parent-div { background: url('/image.jpg'); }
.child-div {
background: #333;
background: linear-gradient(135deg, transparent 30px, #333 0);
}
See it on CodePen
Further reading: