[ 1 ] content: counter(linenumber); を使ったサンプル

		# 1行目
		# 2行目
		# 3行目
		# 4行目

[ 2 ] Pre > Code:Before を使ったサンプル

.screen-reader-text:focus {
	  background-color: #f1f1f1;
	  border-radius: 3px;
	  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	  clip: auto !important;
	  color: #21759b;
	  display: block;
	  font-size: 14px;
	  font-size: 0.875rem;
	  font-weight: 700;
	  left: 5px;
	  line-height: normal;
	  padding: 15px 23px 14px;
	  text-decoration: none;
	}

[ 3 ] https://developer.mozilla.org/ レプリカ

body {
  counter-reset: section;                     /* Set a counter named 'section', and it`s initial value is 0. */
}

h3::before {
  counter-increment: section;                 /* Increment the value of section counter by 1 */
  content: counter(section);                  /* Display the value of section counter */
}
<h3>Introduction</h3>
<h3>Body</h3>
<h3>Conclusion</h3>
body {
  counter-reset: section;                     /* Set a counter named 'section', and it`s initial value is 0. */
}

h3::before {
  counter-increment: section;                 /* Increment the value of section counter by 1 */
  content: counter(section);                  /* Display the value of section counter */
}
<h3>Introduction</h3>
<h3>Body</h3>
<h3>Conclusion</h3>