2016-03-28 9 views
0

In einem epub, würde Ich mag eine einzelne Buchstaben gekennzeichnete Liste auf diese Weise stylen:Stil beschriftete Listen in 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. 

Der folgende Code wird tun, was ich will auf einer Pro-Liste Basis :

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; 
} 

Aber das wird nicht richtig in meiner epub-Datei gerendert. Es kommt heraus, wie folgt aus:

(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. 

Gibt es eine Möglichkeit, es wie das erste Beispiel arbeiten zu lassen?

Antwort

0

versuchen, "list-style-position: outside" hinzuzufügen und "margin-left: 2em;" im liß.

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

Vielen Dank für den Versuch, aber das hat nicht funktioniert. Ich bearbeite das Buch in Calibre, und es wird korrekt wiedergegeben (so auch mein ursprüngliches CSS), aber es wird in Marvin auf meinem iPhone nicht richtig dargestellt. iBooks scheint zu funktionieren, was seltsam ist, weil ich dachte, iBooks und Marvin würden den gleichen HTML-Renderer verwenden. – jlocicero

+0

Whoops! Marvin hat eine Einstellung "Wechseln zu Publisher-Formatierung", und das hat den Trick gemacht. Es wird jetzt korrekt in Marvin gerendert, wenn ich das mache. Danke noch einmal! – jlocicero

+0

willkommen! Froh, dass ich helfen konnte – MrWitts