我正在尝试使用css计数器...... 这是我的css代码:
div.primaries div.entries>div.meaning:first-child:before {
counter-increment: section;
content: counter(section);
}
和html的部分
<div class="primaries">
<div class="headword entries">
<div class="meaning terms">
<span class="meaning terms text">A collection of items of the ...</span>
</div>
<div class="meaning entries">
<div class="example terms">
<span class="example terms text">an arms <em>cache</em></span>
</div>
</div>
<div class="meaning entries">
<div class="example terms">
<span class="example terms text">a <em>cache</em> of gold coins</span>
</div>
</div>
</div>
<div class="headword entries">
<div class="meaning terms">
<span class="meaning terms text">A hidden or inaccessible ...</span>
</div>
</div>
<div class="headword entries">
<div class="meaning terms">
<span class="meaning terms text">An auxiliary memory from ...</span>
</div>
</div>
</div>
我没有使用任何“反复位”。 但是,每个输出的数字都是1。 那么,为什么它总是1?
答案 0 :(得分:5)