1<h1>Heading</h1>
2<h1>This is a longer heading</h1>
3
4h1 {
5 overflow: hidden;
6 text-align: center;
7}
8
9h1:before,
10h1:after {
11 background-color: #000;
12 content: "";
13 display: inline-block;
14 height: 1px;
15 position: relative;
16 vertical-align: middle;
17 width: 50%;
18}
19
20h1:before {
21 right: 0.5em;
22 margin-left: -50%;
23}
24
25h1:after {
26 left: 0.5em;
27 margin-right: -50%;
28}