Last active
February 21, 2017 21:16
-
-
Save MollsReis/28813145692ed59f073a4eb67939dd36 to your computer and use it in GitHub Desktop.
CSS counter
This file contains hidden or 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
<span class="counter">1</span> | |
<span class="counter">2</span> | |
<span class="counter">3</span> | |
<span class="counter">4</span> | |
<span class="counter">5</span> |
This file contains hidden or 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
span.counter { | |
position: relative; | |
display: inline-block; | |
font-family: monospace; | |
font-size: 31px; | |
color: #000; | |
padding: 2px 5px; | |
margin-right: -4px; | |
background-color: transparent; | |
z-index: 1; | |
&:before, &:after { | |
display: block; | |
position: absolute; | |
content: ' '; | |
left: 0; | |
height: 18px; | |
width: 100%; | |
background: #fff; | |
border-radius: 3px; | |
z-index: -1; | |
} | |
&:before { | |
top: 0; | |
} | |
&:after { | |
top: 19px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment