Skip to content

Instantly share code, notes, and snippets.

@yuririn
Last active June 9, 2017 02:25
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/71c9ddb723ea62ad68e56f027bc89d52 to your computer and use it in GitHub Desktop.
Save yuririn/71c9ddb723ea62ad68e56f027bc89d52 to your computer and use it in GitHub Desktop.
/* css */
.numbering {
margin: 0;
counter-reset: number;
}
.numbering h2::before {
counter-increment: number;
content: counter(number);
padding-right: 5px;
}
<!-- html -->
<section class="numbering">
<h1>大見出し</h1>
<h2>中見出し</h2>
<p>本文です本文です本文です本文です本文です本文です本文です本文です本文です本文です</p>
<h2>中見出し</h2>
<p>本文です本文です本文です本文です本文です本文です本文です本文です本文です本文です</p>
<h2>中見出し</h2>
<p>本文です本文です本文です本文です本文です本文です本文です本文です本文です本文です</p>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment