在epub中,我想以这种方式设置单个字母列表:
(a) Some text goes here. (b) More text here. (c) This line is longer. It goes on and on. And on some more. And then it keeps going until it wraps. (d) Another long line. This one will wrap too, once it gets to be long enough. You get the idea. The text should always line up while the list letters hang.
以下代码将按列表执行我想要的操作:
ol.alpha_list {
counter-reset: item;
}
ol.alpha_list > li {
list-style: none;
position: relative;
}
ol.alpha_list li:before {
counter-increment: item;
content:"(" counter(item, lower-alpha) ") ";
position: absolute;
left: -1.4em;
}
但是这在我的epub文件中无法正确呈现。它出来是这样的:
(a) Some text goes here. (b) More text here. (c) This line is longer. It goes on and on. And on some more. And then it keeps going until it wraps. (d) Another long line. This one will wrap too, once it gets to be long enough. You get the idea. The text should always line up while the list letters hang.
有没有办法让它像第一个例子一样工作?
答案 0 :(得分:0)
尝试添加“list-style-position:outside;”和“margin-left:2em;”在li css。
ol.alpha_list {
counter-reset: item;
}
ol.alpha_list > li {
list-style: none;
position: relative;
list-style-position: outside;
margin-left: 2em;
}
ol.alpha_list li:before {
counter-increment: item;
content:"(" counter(item, lower-alpha) ") ";
position: absolute;
left: -1.4em;
}