![]() |
#1 |
Nameless Being
|
Image background in CSS not displaying on Kobo
I have created my own epub version of "The Book of Tea" and am having troubles with chapter headings. What I intend is the chapter number (in Roman numerals) followed by its text and a period (e.g. II. The Schools of Tea.) over-top of a decorative underline (a GIF file).
The textual parts view fine in Sigil, ADE and Calibre and on my Kobo reader. The underline is present except on the Kobo. The CSS for the header is: Code:
#content h3 { text-transform: uppercase; text-align: center; margin: 1.5em 0 1.5em 0; font-size: 1.8em; line-height: 1.5em; letter-spacing: .1em; padding-bottom: 0.75em; /* space between text and image */ background: url('../Images/underline.gif') no-repeat bottom center; } #content h3:after { content: "." } I have searched and can find no exceptions to epub specs saying that the background: url... doesn't work on Kobo. For those who might be willing to help: 1) does the underline display on other devices? 2) any thoughts about how to get the Kobo to display the underline? 3) or...? Thanks, Steven |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
"text-transform", "letter-spacing" and "content" are not included in the ePUB specification, so if any reader supports them it's just a bonus, and you should actually count on their not being supported. If case and period are important, write the "II." directly.
|
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
You could try h3 with a left margin in % or pts so it remains invariant with font size and then use a very slightly larger left margin (also in % or pts) for a separate img carrying the underline gif. Varying the line-height on the img should give you enough control on its vertical position.
e.g. <h3 class="chaphead">...</h3> <div class="ornament"><img src="underline.gif" alt="" class="underlineimg"</img></div> h3 { margin-left: 35%; <-- alter to suit ... } .ornament { margin-top: 0; margin-left: 37%; <--alter to suit vertical-align: top; line-height: 0.5; <--alter to adjust vertical spacing } It's fiddly though, and This sort of fine-grained positional control not really supported by the css subset used in the epub standard. Might be easier just to render your chapter headings as images and embed those. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Standard CSS for Kobo? | CazMar | Sigil | 5 | 09-24-2010 04:47 PM |
Kobo screen flashing when plugged in but no image! | Weblady | Kobo Reader | 2 | 05-11-2010 08:27 PM |
Image of Kobo beside Ebookwise 1150? | guyanonymous | Kobo Reader | 6 | 05-10-2010 09:21 PM |
css, non-repeating background image | ckirchho | ePub | 3 | 06-26-2009 04:35 AM |
Pdf background darker than LRF/RTF background | LOL2005 | Sony Reader | 2 | 10-23-2007 11:00 AM |