CSS: How do I insert a line after a word?

h2 {
  display: flex;
  align-items: center;
}

h2::after {
  content: '';
  flex: 1;
  margin-left: 1rem;
  height: 1px;
  background-color: #000;
}
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.