Horizontal rule/line either side of a heading

I want to have a horizontal rule/line either side of a heading (but not going through the heading text itself). What’s the best way of achieving this look?

Place the rule behind the heading and use an opaque background on the heading would probably be the simplest way.

You could also use an extra tag inside with pseudo elements, or a combination of border and background color, or even a gradient, but that depend on the look you are trying to achieve.

This question has been asked a number of times in the forum and this is the last demo I did based on that question :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.