I made a template using pseudo-element myself, so I can better control the contour and curvatures. I know it was not exactly the same, but sometimes it catches you ...
I did not have to touch anything in your HTML, just in the box where the text is inside I create a ::before
and ::after
These% keys [ ]
will always have the content height, so it does not matter if it has too much or too little text, the "keys" will always fit the content.
The trick here was to construct a rectangle on each side of the text box and remove the edge from inside that square, to make the corners rounded, just use border-radius
. But as I said at the beginning does not look exactly the same as the image
.indicacoes {
font-family: 'AmaticBold';
font-size: 40px;
margin-top: 30px;
text-align: center;
}
.texto-principal {
padding: 1rem;
width: 50%;
margin: 1rem auto;
position: relative;
}
.texto-principal::after,
.texto-principal::before {
content: "";
position: absolute;
top: 0;
width: 4em;
height: 100%;
border: .5em solid currentColor;
border-radius: .5em;
}
.texto-principal::after {
left: 0;
border-right: 0;
}
.texto-principal::before {
right: 0;
border-left: 0;
}
<div class="container">
<div class="texto-principal">
<p id="borderimg" class="indicacoes">
texto de teste! <br>
TEXTO TEXTO TEXTO TEXTO. <br>
TEXTO TEXTO TEXTO.
</p>
</div>
</div>