风格在EPUB
问题描述:
ePub的字母列表,我想以这种方式来样式单字母的列表:风格在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.
有没有什么办法让它像第一个例子中的工作?
答
尝试添加“list-style-position:outside;”和“margin-left:2em;”在里斯本。
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;
}
谢谢你尝试,但没有奏效。我在Calibre编辑这本书,并且它正确呈现(我的原始CSS也是如此),但是它在我的iPhone上的Marvin中无法正确呈现。虽然iBooks似乎有效,但这很奇怪,因为我认为iBooks和Marvin会使用相同的HTML渲染器。 – jlocicero
哎呀!马文有一个“切换到出版商的格式”的设置,并且这有诀窍。当我这样做时,它现在在马文中呈现正确。再次感谢! – jlocicero
欢迎!很高兴我能帮上忙 – MrWitts