Html 定位订单列表中较低的alpha项目符号
使用下面的CSS,我可以得到一个列表,使用低阿尔法项目符号,每边都有大括号,但现在计数器似乎在内容中没有分隔,因此看起来像: 发生了什么:Html 定位订单列表中较低的alpha项目符号,html,css,Html,Css,使用下面的CSS,我可以得到一个列表,使用低阿尔法项目符号,每边都有大括号,但现在计数器似乎在内容中没有分隔,因此看起来像: 发生了什么: (a) this is my content in the list item that has the bullets inlined with the content 我想要的是: (a) this is what I'd rather have that occurs in native lists, but doesn't hav
(a) this is my content in the list item
that has the bullets inlined with the
content
我想要的是:
(a) this is what I'd rather have that
occurs in native lists, but doesn't
have lower-alpha with braces
CSS:
ol {
counter-reset: list;
margin: 0;
padding: 25px;
}
ol > li {
list-style: none;
position: relative;
}
ol > li:before {
counter-increment: list;
content: "(" counter(list, lower-alpha) ") ";
/* position: absolute;
left: -1.4em;*/
}
看起来是你干的。如果左侧有用作置换的填充,则绝对可以相对于父元素定位伪元素:
ol{
计数器复位:列表;
填充:0;
}
ol>li{
列表样式:无;
位置:相对位置;
左:2米;
}
李:以前{
计数器增量:列表;
内容:“(计数器(列表,低字母)”;
位置:绝对位置;
左:0;
}
Lorem ipsum dolor sit amet,是一位杰出的献身者。我们最大的优点是不易弯曲。马萨的奎斯克身份证精英sollicitudin nunc bibendum aliquet身份证。南·马蒂斯是亨德雷特·普雷蒂姆大学的学生。时间过得真快,你的名言是什么。毛里斯·奎斯·菲尼布斯·多洛
Lorem ipsum dolor sit amet,是一位杰出的献身者。我们最大的优点是不易弯曲。马萨的奎斯克身份证精英sollicitudin nunc bibendum aliquet身份证。南·马蒂斯是亨德雷特·普雷蒂姆大学的学生。时间过得真快,你的名言是什么。毛里斯·奎斯·菲尼布斯·多洛
Lorem ipsum dolor sit amet,是一位杰出的献身者。我们最大的优点是不易弯曲。马萨的奎斯克身份证精英sollicitudin nunc bibendum aliquet身份证。南·马蒂斯是亨德雷特·普雷蒂姆大学的学生。时间过得真快,你的名言是什么。毛里斯·奎斯·菲尼布斯·多洛
如果您只是取消注释绝对位置属性,它就会工作
ol > li:before {
counter-increment: list;
content: "(" counter(list, lower-alpha) ") ";
position: absolute;
left: -1.4em;
}
在这里你可以看到一把小提琴:
也发布你的HTML谢谢,你是对的,看起来我确实有,但我想我没有做足够的替换,看起来什么也没做。干杯