0

I'm trying to put lines before and after h2 texts, like this:

----- About Our Line -------------------

I found this post: CSS technique for a horizontal line with words in the middle

But the thing is I have a lot of h2s, so I can't set different widths for individual h2s.

Maybe there's a solution?

Community
  • 1
  • 1
Jaeeun Lee
  • 3,056
  • 11
  • 40
  • 60

1 Answers1

0
    h2:before, h2:after {
     content: '----------';
    }
    <div>
      <h2>About Our Line</h2>
    </div>
.h2:before, h2:after { content: '----------'; }
Vivek B
  • 1
  • 1
  • 3