I would like to make the below shape responsive with CSS. The rectangle has width 80% of its container and has text inside it. I know how to do triangles with css using border but borders accept only pixels. How to make the whole shape responsive so when the screen size is smaller and the text inside moves to a new line, the triangle grows according to the growth of the rectangle ?
Code so far:
<div class="wrapper">
<p class="text">bla blah some long text here try to resize</p>
</div>
.wrapper {
background-color: #16b629;
width: 80%;
position: relative;
left: 20%;
}
.wrapper::before {
content: "";
position: absolute;
left: -23px;
bottom: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 0 46px 23px;
border-color: transparent transparent #16b629 transparent;
z-index: 999;
}
.text {
padding: 10px 0;
font-size: 21px;
font-weight: bold;
font-style: normal;
font-stretch: normal;
line-height: 1.27;
letter-spacing: -0.2px;
text-align: center;
color: #ffffff;
text-shadow: 0.5px 0.9px 2px rgba(27, 29, 27, 0.94);
}