本文介绍了跳过有序列表项编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个有序列表,我想跳过某个特定项目的输出。
I have an ordered list and I'd like to skip the number output from a particular item.
传统输出:
1. List item
2. List item
3. List item
4. List item
5. List item
所需输出:
1. List item
2. List item
Skipped list item
3. List item
4. List item
5. List item
这是否可以在CSS中实现?我发现了
Is this achievable in CSS? I discovered an <ol>
"start" attribute that I didn't know about before, but doesn't seem to help me.
推荐答案
另一个选择是使用CSS3计数器:
Another option is to use CSS3 counters: demo
HTML
HTML
<ul>
<li>One</li>
<li>Two</li>
<li class="skip">Skip</li>
<li>Three</li>
<li>Four</li>
</ul>
CSS
ul {
counter-reset:yourCounter;
}
ul li:not(.skip) {
counter-increment:yourCounter;
list-style:none;
}
ul li:not(.skip):before {
content:counter(yourCounter) ".";
}
ul li.skip:before {
content:"\a0\a0\a0"; /* some white-space... optional */
}
这篇关于跳过有序列表项编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!