03-02-2011, 02:02 PM | #1 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
ePub not using CSS
Okay, I'm pulling out my hair. For some reason, my latest conversion isn't registering the CSS. I've even copied and pasted the CSS from a successful conversion into this one...removed every chunk I could find...blah, blah...can't find the error.
Hell, the thing even validates just fine. But when I open it in Sigil, for instance, the style sheet has only one entry. Plus, instead of the thirty chapters, it's only been spliced into 3 sections (and I can't even figure out what sets those three sections apart). I know this is a very broad question -- but does anyone have any ideas of what I might've done wrong? |
03-02-2011, 02:18 PM | #2 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
And here's the CSS I'm using:
<style type="text/css" media="screen"><!-- img.sgc-1 {width:300px; max-width:100%;} .backcover { height: auto; max-width: 100%; width: 600px;} h3 {display: block; font-size: 2em; font-weight: bold; margin-bottom: 0.83em; margin-left: 0; margin-right: 0; margin-top: 0.83em; page-break-before: always; text-align: center; font-family: sans-serif;} h3.Chapter { text-align: right; } img.czp { height: auto; margin-top: 2em; max-width: 40%; width: 100px; margin: auto; } .center1 { display: block; margin-bottom: 0; margin-left: auto; margin-right: auto; margin-top: 0; text-align: center; } p.chizine-body-indent- { display: block; font-size: 1em; margin-bottom: 0.3em; margin-left: auto; margin-right: auto; margin-top: 0.3em; text-align: left; text-indent: 25pt; } .spacer { display: block; margin-bottom: 1.2em; } p.chizine-body-no-indent- { display: block; font-size: 1em; margin-bottom: 0.3em; margin-left: auto; margin-right: auto; margin-top: 0.3em; text-align: left; text-indent: 0pt;} .smaller { font-size:85%; } .pagebreak { display: block; page-break-before: always; } --></style> |
03-02-2011, 02:43 PM | #3 |
Wizard
Posts: 4,334
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
Mmm, conversion ?
From what format ? To what format ? With what software ? |
03-02-2011, 02:44 PM | #4 | |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Quote:
Is there another html to ePub conversion program? |
|
03-02-2011, 06:10 PM | #5 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
I take it you've used the MEDIA attribute before without any problem? I haven't had any reason to use that so don't know one way or the other, but wondering if Calibre might be barfing on it?
|
03-02-2011, 08:47 PM | #7 | |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Quote:
However, my CSS came back clean. No ideas. I created the ePub using Sigil (I honestly didn't know I could create one...I thought it was only for editing) and it displays just fine. Really wish I knew what the heck went wrong with Calibre though. Very bizarre. |
|
03-02-2011, 09:05 PM | #8 |
Well trained by Cats
Posts: 30,377
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
<style type="text/css" media="screen"><!--
< style stuff snipped> --></style> Because those marks mean ? (test at 6 ) The stuff between is a COMMENT |
03-02-2011, 09:54 PM | #9 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
That's standard practice when coding a web page - stops the browser trying to interpret the CSS as HTML (though I suspect that's only something that's an issue for older browser versions). However, yes, it might well be worth removing the comment tags when coding for an ebook.
|
03-03-2011, 08:43 AM | #10 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
You know it *will* be something like that...but sadly that's not the case. Hell, I've even tried linking to an external sheet but the same thing. I just can't figure it out. I remember this happened to me once before it was because there was an undeclared id tag (the whole document was wrapped in ID tag).
|
03-03-2011, 09:01 AM | #11 |
frumious Bandersnatch
Posts: 7,533
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Have you tried removing media="screen"? And you are placing the whole <style> stuff inside the <head>, aren't you?
Proceed little by little. For instance, use this: Code:
<style type="text/css"> body { color: red } </style> |
03-03-2011, 09:55 AM | #12 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
|
03-04-2011, 11:25 AM | #13 | |
Enthusiast
Posts: 41
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Quote:
And as someone else suggested, I started removing every component, bit by bit and I was still getting the same result. I even started replacing it with components from successful conversions. But I ended up making the ePub with Sigil, then doing a little manual correction of the TOC and the content.opf file and it's turned out great. I really wish I knew what caused this for future reference...but no idea. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epub CSS versus "Regular" CSS | konrad | ePub | 4 | 02-18-2011 09:29 AM |
Epub - CSS aufräumen | ThR | Erste Hilfe | 0 | 02-07-2011 05:27 AM |
EPUB (CSS) tweaker app | Loccy | Conversion | 9 | 01-23-2011 10:22 PM |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
ePub to ePub - just replace CSS? | ChristopherTD | Calibre | 21 | 02-11-2010 02:50 AM |