2016-03-28 31 views
0

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. 

有沒有什麼辦法讓它像第一個例子中的工作?

回答

0

嘗試添加「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; 
} 
+0

謝謝你嘗試,但沒有奏效。我在Calibre編輯這本書,並且它正確呈現(我的原始CSS也是如此),但是它在我的iPhone上的Marvin中無法正確呈現。雖然iBooks似乎有效,但這很奇怪,因爲我認爲iBooks和Marvin會使用相同的HTML渲染器。 – jlocicero

+0

哎呀!馬文有一個「切換到出版商的格式」的設置,並且這有訣竅。當我這樣做時,它現在在馬文中呈現正確。再次感謝! – jlocicero

+0

歡迎!很高興我能幫上忙 – MrWitts