I need to put this image, and also make this risk at the center of it. Is there any kind of border that make this?
HTML:
<div id="discussoes">
<img id ="img-topico" src="botão - criar tópico.png"/>
</div>
You can do it with a pseudo element. This solution is flexible (works with every image/line height).
HTML
<div class="middle-border">
<img/>
</div>
CSS
img {
width: 80px;
height: 80px;
background: blue;
display: block;
margin: 0 auto;
z-index: 2;
position: relative;
}
.middle-border {
position: relative;
background: yellow;
text-align: center;
}
.middle-border::before {
content: "";
display: block;
height: 5px;
background: red;
width: 100%;
position: absolute;
z-index: 1;
top: 50%;
transform: translateY(-50%);
}
Result