JSFiddle - React, Tailwind, and code Playground
by leshiple
HTML
<section>
<div></div>
</section>
CSS
* {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
body {
padding: 100px;
margin: 0;
}
section {
width: 350px;
height: 500px;
background-color: #eee;
position: relative;
}
section::before {
content: "";
position: absolute;
left: 12px;
bottom: 40px;
width: 378px;
height: 0;
transform: skewY(10deg);
transform-origin: top left;
box-shadow: 0 0 3px 10px hsla(0, 0%, 11%, 0.3);
z-index: -1;
}
div {
position: absolute;
width: 400px;
height: 100px;
border: 1px dotted red;
transform: skewY(10deg);
transform-origin: top left;
overflow: hidden;
left: 0;
bottom: 40px;
}
div::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #ff0;
transform: skewY(5deg);
transform-origin: top left;
}