-
-
Save szpakoli/6296264 to your computer and use it in GitHub Desktop.
Decimal Leading Zero CSS Counter Reference:
http://test.csswg.org/suites/css2.1/20101210/xhtml1/content-counter-006.xht
http://www.w3.org/TR/2013/WD-css-counter-styles-3-20130718/#counter-styles
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
#test { counter-reset: c; } | |
#test span { counter-increment: c; } | |
#test span:before { content: counter(c, decimal-leading-zero); } |
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
ol > li { | |
position:relative; /* Create a positioning context */ | |
margin:0; /* Give each list item a left margin to make room for the numbers */ | |
padding:30px 0 30px 70px; /* Add some spacing around the content */ | |
list-style:none; /* Disable the normal item numbering */ | |
border-top:1px solid @black-20; | |
background: @white; | |
} | |
ol > li:before { | |
counter-increment:li; /* Increment the counter by 1 */ | |
content: counter(li, decimal-leading-zero); | |
position:absolute; | |
top: 20px; | |
left:0px; | |
-moz-box-sizing:border-box; | |
-webkit-box-sizing:border-box; | |
box-sizing:border-box; | |
/* Some space between the number and the content in browsers that support | |
generated content but not positioning it (Camino 2 is one example) */ | |
margin-right:30px; | |
padding:17px 0; | |
border-top:1px solid @black-20; | |
color:@blue; | |
background:url(/images/ol-circle.png) no-repeat 0 0; | |
font-weight:bold; | |
font-family: @serif; | |
text-align:center; | |
.font-size(19); | |
width: 55px; | |
height: 55px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment