我想通过 CSS 添加一个增量值,但显然我做错了什么。
HTML
<ul role="menu" style="left: 0px; position: absolute; top: 0px;">
<li id="Slideshow-13675338798500">
<a class="slideshow-thumbnails-hidden" href="images/slideshow/slide-1.png" role="menuitem" tabindex="0">
<span class="thmubbutton"></span>
</a>
</li>
<li id="Slideshow-13675338798501">
<a class="slideshow-thumbnails-hidden" href="images/slideshow/slide-2.png" role="menuitem" tabindex="1">
<span class="thmubbutton"></span>
</a>
</li>
<li id="Slideshow-13675338798502">
<a class="slideshow-thumbnails-hidden" href="images/slideshow/slide-3.png" role="menuitem" tabindex="2">
<span class="thmubbutton"></span>
</a>
</li>
</ul>
css
span.thmubbutton{
counter-increment: myIndex;
}
span.thmubbutton:before
{
content:counter(myIndex);
}
输出是1 | 1 | 1