Skip to content

Instantly share code, notes, and snippets.

@rzvl
Created July 10, 2021 18:30
Show Gist options
  • Save rzvl/0189dc3d6f1ae76720dfd136b59634a1 to your computer and use it in GitHub Desktop.
Save rzvl/0189dc3d6f1ae76720dfd136b59634a1 to your computer and use it in GitHub Desktop.
CSS technique for a horizontal line with words in the middle
h1 {
display: flex;
flex-direction: row;
}
h1:before, h1:after{
content: "";
flex: 1 1;
border-bottom: 1px solid;
margin: auto;
}
h1:before {
margin-right: 10px
}
h1:after {
margin-left: 10px
}
@rzvl
Copy link
Author

rzvl commented Jul 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment