How to use css to make the underscore?

Want to make h1, which underscores performed as in the screenshot below. I do not understand how to do it.

dac67836f3b5420b83b6635646efd23b.png
July 4th 19 at 22:45
2 answers
July 4th 19 at 22:49
h1 {
background-image: url('../img/red_line.png');
background-repeat: no-repeat;
background-position: center 15px;
padding: 0 0 5px 0;
}
donat: https://money.yandex.ru/to/410013973761588/50
July 4th 19 at 22:47
Solution
using :after
h1 {position: relative;}
h1:after {
 content: ";
 display: inline-block;
 width: 100px;
 height: 2px;
 position: absolute;
 bottom: -5px;
 left: 50%;
 transform: translateX(-50%);
 background: red;
}
display: inline-blcok; - Edwin.Abbo commented on July 4th 19 at 22:50
display: inline-block;* - linnie55 commented on July 4th 19 at 22:53
: : Oh - Rosendo_Hess commented on July 4th 19 at 22:56
that worked. Only there is one. In layout the fixed menu, and this strip is scrolled over the menu - Vivianne.Hermiston9 commented on July 4th 19 at 22:59
: where the relative is not there asked. it is necessary to look. you can throw the code on https://jsfiddle.net - Rosendo_Hess commented on July 4th 19 at 23:02
: https://jsfiddle.net/qcmn2vhL/ - Vivianne.Hermiston9 commented on July 4th 19 at 23:05
: well, where is the underscore? - Rosendo_Hess commented on July 4th 19 at 23:08
: ugh. Inserted, but does not see why it https://jsfiddle.net/qcmn2vhL/2/ - Vivianne.Hermiston9 commented on July 4th 19 at 23:11
: https://jsfiddle.net/qcmn2vhL/3/ Title we need to set the property position: relative; And the dash to add position: absolute; - Emmett.Goldn commented on July 4th 19 at 23:14
: https://jsfiddle.net/qcmn2vhL/6/ that's about what I said, scroll down a bit - Vivianne.Hermiston9 commented on July 4th 19 at 23:17
don't need no Absolutes (especially where it is possible to do)
h1:after {
 content: ";
 display: block;
 width: 100px;
 height: 2px;
 background: red;
 margin: auto;
}
- Lulu_Zulauf71 commented on July 4th 19 at 23:20
: Set the nav tag a z-index property with a value greater than that of the header. For example, try z-index: 1; https://jsfiddle.net/qcmn2vhL/7/ - Emmett.Goldn commented on July 4th 19 at 23:23
: Everything! turned out, Thank you very much) - Vivianne.Hermiston9 commented on July 4th 19 at 23:26

Find more questions by tags CSSHTML