css li:从右到左的方向
我编写了一些代码来删除有序列表中的小数点。这是我的代码:css li:从右到左的方向,css,Css,我编写了一些代码来删除有序列表中的小数点。这是我的代码: ol { list-style-type: none; counter-reset: level1 } ol li:before { content: counter(level1) " "; counter-increment: level1; } 它不显示小数点,但显示的数字方向为从左到右,如下所示 7 xxxxx 8 xxxxx 9 xxxxx 10 xxxxx 11 xxxxx 所需结果:从
ol {
list-style-type: none;
counter-reset: level1
}
ol li:before {
content: counter(level1) " ";
counter-increment: level1;
}
它不显示小数点,但显示的数字方向为从左到右,如下所示
7 xxxxx
8 xxxxx
9 xxxxx
10 xxxxx
11 xxxxx
所需结果:从右到左,如记事本++行号 7 xxxxx
8 xxxxx
9 xxxxx
10 xxxxx
11 xxxxx
我尝试过css“direction:rtl”,但没有成功。
关于如何实现这一点有什么想法吗?非常感谢 尝试以下解决方案:
ol{
列表样式类型:无;
计数器复位:1级;
}
奥利:以前{
内容:柜台(一级)”;
反增量:1级;
显示:内联块;
文本对齐:右对齐;
最小宽度:20px;
}
测试1
测试2
测试1
测试2
测试1
测试2
测试1
测试2
测试1
测试2
尝试将这些样式添加到您的ol li:before
-
你可以玩更多的阅读游戏
ol li:before {
content: counter(level1) " ";
counter-increment: level1;
/* below CSS added */
color: red;
display: inline-block;
width: 1em;
margin-left: -1.5em;
margin-right: 0.5em;
text-align: right;
direction: rtl
}