Created
March 25, 2019 15:43
-
-
Save SebastianGaud/3ebe48c94cc68a0323a34960dd5e0a84 to your computer and use it in GitHub Desktop.
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
<style> | |
.strike { | |
display: block; | |
text-align: center; | |
overflow: hidden; | |
white-space: nowrap; | |
} | |
.strike > span { | |
position: relative; | |
display: inline-block; | |
} | |
.strike > span:before, | |
.strike > span:after { | |
content: ""; | |
position: absolute; | |
top: 50%; | |
width: 9999px; | |
height: 1px; | |
background: red; | |
} | |
.strike > span:before { | |
right: 100%; | |
margin-right: 15px; | |
} | |
.strike > span:after { | |
left: 100%; | |
margin-left: 15px; | |
} | |
</style> | |
<div class="strike"> | |
<span>Kringle</span> | |
</div> | |
It is working |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original version: https://stackoverflow.com/questions/2812770/add-centered-text-to-the-middle-of-a-hr-like-line