Would like the responsive rectangular trapezoid figure to fit the screen at all times without white borders and that when it reaches mobile, it becomes a rectangle as a bar.
When you reduce the rectangular trapezoid it becomes small and should fit the screen
<body>
<div>
<img src="https://picsum.photos/300" alt="">
<span class="before"> </span>
<span class="after"> </span>
</div>
</body>
<style>
div {
display: block;
z-index: 1;
position: relative;
/* custom sizes */
width: 30vw;
height: 50vw;
top: -14px;
background-color: #9a9ebe;
}
div .before,
div .after {
position: absolute;
top: 0;
width:50vw;
bottom: 0;
z-index: -1;
border-radius: 2px;
background-color:#9a9ebe;
}
div .before {
transform: skew(-15deg);
}
div .after {
transform: skew( 2deg);
right: 15vw;
}
img{
position: absolute;
margin-top: 290px;
margin-left: 10vw;
width: 20vw;
}
</style>