Skip to content

Instantly share code, notes, and snippets.

@EvilScott
Last active February 21, 2017 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvilScott/28813145692ed59f073a4eb67939dd36 to your computer and use it in GitHub Desktop.
Save EvilScott/28813145692ed59f073a4eb67939dd36 to your computer and use it in GitHub Desktop.
CSS counter
<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>
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