【发布时间】:2019-03-16 20:01:10
【问题描述】:
问题来了:
我有一个带有start 属性的ol li 有序列表,如下所示:
.custom {
margin: 0;
padding: 0;
list-style-type: none;
}
.custom li {
counter-increment: step-counter;
margin-bottom: 10px;
}
.custom li::before {
content: counter(step-counter);
margin-right: 5px;
font-size: 80%;
background-color: rgb(0,200,200);
color: white;
font-weight: bold;
padding: 3px 8px;
border-radius: 3px;
}
<ol start="6" class="custom">
<li>This is the sixth item</li>
<li>This is the seventh item</li>
<li>This is the eighth item</li>
<li>This is the ninth item</li>
<li>This is the tenth item</li>
</ol>
我在浏览器上得到以下输出:
是否可以使用start 属性中的值而不是1 对有序列表中的list-style 编号进行序列化?但是,没有 JavaScript 可以用于此。
【问题讨论】:
标签: html css html-lists semantic-markup