I´m happy to be a new member of this forum. I have invested much time, but I cannot find a solution to make the CSS underline like the following picture:
Here how it should look:
It is a heading with centered text. At bigger screens, the text is displayed in just one line.
It would be nice if the red underline isn´t directly connected with the words (so that it behaves responsively).
Did you make the picture or was it a screenshot from a working website? If from a website, use the dev tools in your browser to inspect the element to see what the code is.
Would that break line like the image shows? The line looks to be lower than a typical underline. Maybe some kind of :after code is being used.
I worked it out.
Put the text into a <span></span> apply a bottom border to the span and add a white background in your CSS. You can add padding to the span to increase the distance between the bottom of the text and the underline. You can experiment with line-height: as well.