我想在不使用有序列表的情况下对段落进行编号。我试图通过在 CSS 中使用 content:counter(paragraph) 来实现这一点,这样我创建的每个段落块都会在它的左侧生成一个数字。
.pass {
  counter-reset:paragraph;
}
.pass p:before {
  content:counter(paragraph);
  position:absolute;
  font-size:0.6em;
  color:#999;
  margin-left:-3em;
  counter-increment: paragraph;
}
它工作正常,但问题是我无法弄清楚如何对齐数字,以便它们都对齐到右边。
所以而不是:
7   Content
8   Content
9   Content
10  Content
我希望它们看起来像这样:
 7  Content
 8  Content
 9  Content
10  Content
没有 OL 和 LI 有没有办法做到这一点?