Having trouble adding an irregular shape before a div.
I'm looking to achieve the effect shown in this image:
However, I want this effect to cover the entire content of the div, not just the left or bottom. I attempted to use CSS arrows created with borders, but it didn't produce the desired outcome.
Would it be better to use borders in combination with transparent color and ::before
, ::after
pseudo elements, or the background-clip
property?
Here is my HTML structure
.wrapper::before {
display: block;
height: 0px;
width: 0px;
border-left: 5px solid transparent;
border-right: 650px solid transparent;
border-bottom: 50px solid black;
}
.content {
background-color: #f2f2f2;
box-sizing: border-box;
color: #000;
text-transform: uppercase;
}
<div class="wrapper">
<div class="content">
Content
</div>
</div>
Is there a way to combine ::after
and ::before
pseudo-elements to achieve this effect for the entire div?