Created
September 28, 2017 09:43
-
-
Save may88seiji/7aba03513e339b38c0d02f3f6103d7dc to your computer and use it in GitHub Desktop.
counterを利用した自動ナンバリング http://design-studio-f.com/blog/css-counter-automatic-numbering/
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
body { | |
counter-reset: number 0; /* number のカウンタを 0 にセット */ | |
} | |
h1:before { | |
counter-increment: number 1; /* number カウンタの増加数をセット */ | |
content: counter(number) " "; /* 表示形式を指定 */ | |
} |
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
ol { | |
counter-reset: item; | |
list-style-type: none; | |
} | |
li { display: block; } | |
li:before { | |
content: counter(item, decimal-leading-zero) " "; | |
counter-increment: item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment