使用 Css,而不是 html 属性“reverse”。 我可以这样实现它:
<ol reversed>
<li>test</i>
<li>test2</li>
</ol>
但我想用CSS来做
最佳答案
CSS 反转
ol.reverse {
list-style: none;
counter-reset: reverse 11;
}
ol.reverse > li:before {
content: counter(reverse) '.';
display: block;
left: -30px;
position: absolute;
text-align: right;
width: 20px;
}
ol.reverse li {
counter-increment: reverse -1;
position: relative;
}
你的代码应该是
<ol class="reverse">
<li>test</i>
<li>test2</li>
</ol>
关于css - 如何更改ol列表的列表顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26038710/