<h1>Elegant Heading</h1>
h1 {
  display: grid;
  grid-template-columns: minmax(50px, 1fr) auto minmax(50px, 1fr);
  align-items: center;
  text-align: center;
  gap: 40px;

h1::before, h1::after {
  content: '';
  border-top: 6px double;

/* everything below is for demo appearances and not important to the concept */

body, h1 {
  margin: 0;

body {
  box-sizing: border-box;
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 20px;
  color: #212529;
  background-color: #f8f9fa;
  font-family: 'Merriweather', serif

@media (max-width: 400px) {
  h1 { font-size: 1.5rem; }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.