you could also do it this way, in my case i use it before and after an h1 (brute force it ehehehe)
.titleImage::before {
content: "--------";
letter-spacing: -3px;
}
.titreImage::after {
content: "--------";
letter-spacing: -3px;
}
If the letter spacing makes it so the line get in the text just use a margin to push it away!