<div class="wrapper">
<div class="box">
Первый вариант
</div>
<div class="box-two">Второй вариант</div>
</div>
.wrapper {
display: flex;
justify-content: space-around;
}
.box {
background: orange;
width: 400px;
height: 250px;
display: flex;
justify-content: center;
align-items: center;
font-size: 34px;
color: #fff;
padding: 10px;
// следующее свойство обрезает блок (слабая поддержка)
clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%);
}
.box-two {
width: 400px;
height: 250px;
display: flex;
justify-content: center;
align-items: center;
font-size: 34px;
color: #fff;
padding: 10px;
margin-left: 20px;
position: relative;
overflow: hidden;
&:before {
content: '';
position: absolute;
left: 50px;
z-index: -1;
width: 100%;
height: 100%;
background: orange;
transform: skewX(-20deg)
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.