Skip to content

Instantly share code, notes, and snippets.

@yuririn
Last active June 9, 2017 02:24
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 yuririn/2c4cd588ff0ca1171851c930ee4f8dfd to your computer and use it in GitHub Desktop.
Save yuririn/2c4cd588ff0ca1171851c930ee4f8dfd to your computer and use it in GitHub Desktop.
/* css */
.list-family ol{
list-style: none;
counter-reset: cnt;
padding-left: 0;
}
.list-family ol li{
margin-bottom: 8px;
}
.list-family ol li::before{
content: counters(cnt, ".") ". ";
counter-increment: cnt;
}
.list-family ol ol{
counter-reset: cnt;
margin-left: 20px;
margin-top: 8px;
margin-bottom: 0;
}
<!-- html -->
<div class="list-family">
<ol>
<li>リスト</li>
<li>リスト
<ol>
<li>子リスト</li>
<li>子リスト</li>
</ol>
</li>
<li>リスト</li>
<li>リスト
<ol>
<li>子リスト</li>
<li>子リスト
<ol>
<li>孫リスト</li>
<li>孫リスト</li>
</ol>
</li>
</ol>
</li>
</ol>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment