<div class="wrapper">
<div class="left-content"><span>left</span></div>
<div class="right-content"><span>right</span></div>
</div>
.wrapper {
display: flex;
flex-direction: row;
color: white;
font-family: system-ui;
font-size: 2rem;
overflow: hidden;
margin: 0 auto;
}
.left-content,
.right-content {
width: 50%;
height: 400px;
display: flex;
justify-content: center;
align-items: center;
}
.left-content {
position: relative;
}
.left-content::after {
content: "";
position: absolute;
background: blue;
top: 0;
bottom: 0;
right: 0;
width: 100vw;
transform: skew(-25deg);
z-index: 10;
}
.right-content {
position: relative;
text-align: right;
}
.right-content::before {
content: "";
position: absolute;
background: red;
top: 0;
bottom: 0;
left: 0;
width: 100vw;
transform: skew(-25deg);
z-index: 10;
}
span {
z-index: 20;
}
https://codepen.io/xiaogwu/pen/XWoKQzw?editors=1100