Created
July 10, 2021 18:30
-
-
Save rzvl/0189dc3d6f1ae76720dfd136b59634a1 to your computer and use it in GitHub Desktop.
CSS technique for a horizontal line with words in the middle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Today</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source: CSS technique for a horizontal line with words in the middle