我将我们的组织章程放在网上。我已经构建了CSS来管理大纲:
ol {
list-style-type: none;
counter-reset: bylawcounter;
}
ol li {
font-weight: bold;
font-size: 24px;
}
ol li:before {
content: "Bylaw " counter(bylawcounter,upper-roman) " - ";
counter-increment:bylawcounter;
}
ol ol {
list-style-type: none;
counter-reset: sectioncounter;
}
ol ol li {
font-weight: bold;
font-size: 20px;
}
ol ol li:before {
content: "Section " counter(bylawcounter) "." counter(sectioncounter) " - ";
counter-increment:sectioncounter;
}
li p {
font-weight: normal;
font-size: 16;
}
这部分正在游泳。接下来我需要的是章程中的一些项目引用其他项目。我想让HTML自动引用,而不是硬编码,这样如果章程被修改,引用将是正确的而不改变它。例如:
<ol>
<li>Organization</li>
<ol>
<li id="name">Name
<p>This organization shall be known as "ABC, Inc.".</p></li>
<li>Other Names
<p>This organization shall never be know by any name not specified in <a href="#name">Section 1.1</a>.</p></li>
</ol>
</ol>
因此,我想引用id“Name”而不是硬编码“Section 1.1”,而是获取相关的计数器。这可能在HTML或JS中吗?