【发布时间】:2022-01-24 17:24:22
【问题描述】:
2我想在 html 中将一些标题显示为字母而不是数字。
例如,如果我有以下 html 描述:
<h1>the first chapter</h1>
<h2>the first sub-chapter</h2>
<h1>the second chapter</h1>
我明白了:
1 the first chapter
1.1 the first sub-chapter
2 the second chapter
有可能(例如通过使用 CSS)有类似的东西:
A the first chapter
A.1 the first sub-chapter
B the second chapter
【问题讨论】:
-
我不明白您如何获得显示的第一个输出。数字从何而来?然后,不清楚你在问什么。您想在标题前添加
A和B?通过什么算法?这似乎完全是任意的。请修改得更清楚。 -
而您的原始 HTML 有一些复杂的标签。第二个元素是 H1 还是 H2?
-
必须有一些代码可以创建这些编号,请您将其添加到您的问题中。
标签: html css html-heading