Mobileread
CSS odd behavior with ADE/Sony Reader
#1  AbominableDavid 03-25-2010, 08:03 PM
I've used Sigil in the past to modify other ebooks with great success. I decided it was time to create my own ebook and have spent the last few days scanning a book I own and using Sigil to create the ebook.

It looks great in Sigil and it looks great in calibre. In ADE and on my PRS-505, however, the css doesn't seem to be applied to the text.

I've got the link to the css file in the <head></head> section of each chapter
Code
 <link rel="stylesheet" href="../styles/style0001.css" type="text/css" />
The css file is part of the archive, and I can't figure out why it works in Sigil and Calibre but not in ADE and my reader.

Any suggestions?
Reply 

#2  Valloric 03-25-2010, 08:11 PM
If it looks great in both Sigil and Calibre, then it's an ADE issue. That's not very surprising, ADE has its fair share of faults.

If you could provide the epub file, then others could help you find the root cause.
Reply 

#3  AbominableDavid 03-25-2010, 08:37 PM
Quote Valloric
If it looks great in both Sigil and Calibre, then it's an ADE issue. That's not very surprising, ADE has its fair share of faults.

If you could provide the epub file, then others could help you find the root cause.
I don't feel comfortable providing the epub - it's a commercial work that I've digitized for my own use.

I'll see if I can recreate the problem with some public domain work and post that.
Reply 

#4  charleski 03-25-2010, 09:43 PM
ADE is VERY fussy about errors in the CSS. My bet is that there's a spelling mistake or missing ; that you've overlooked. This will cause ADE to throw out the CSS file.
Reply 

#5  paulpeer 03-26-2010, 02:54 PM
Quote charleski
ADE is VERY fussy about errors in the CSS.
Yes, the latest problem I had was this: instead of
Code
font-size: 80%;
I had written
Code
font-size: 80 %;
And this one little space was enough for ADE to reject the whole CSS!
Reply 

#6  paulpeer 03-26-2010, 02:55 PM
Quote AbominableDavid
I don't feel comfortable providing the epub - it's a commercial work that I've digitized for my own use.

I'll see if I can recreate the problem with some public domain work and post that.
Just post the CSS. Very likely the problem is there, and not in the book.
Reply 

#7  AbominableDavid 03-26-2010, 08:00 PM
Quote paulpeer
Just post the CSS. Very likely the problem is there, and not in the book.
Very good idea.

I just used the CSS generated by my OCR program, with a few modifications.

Code
h1 {text-align: center; font-size: 150%; font-weight: bold;} span.sgc-6 {font-style: italic;} p.sgc-4 {margin-left: 2%; margin-right: 2%; margin-top: 0; margin-bottom: 0; text-indent: 3%} p.opener {margin-left: 2%; margin-right: 2%; margin-top: 0; margin-bottom: 0; text-indent: 0} p.sgc-2 {font-weight: bold} hr.spacing {margin: 2em 25%;}
Actually, just as an experiment, I pasted my css code above directly into one of the chapter headers, between <style></style> headers, and that chapter appeared the way I expected - so I must have not done something correctly linking the style sheet.
Reply 

#8  AbominableDavid 03-26-2010, 08:12 PM
I think I've got it fixed - I didn't know capitalization was important.

I had this link in each of my chapters:
Code
 <link rel="stylesheet" href="../styles/style0001.css" type="text/css" />
The Folder/File structure in the zip file, though, was Styles/Styles0001.css.

Once I changed the case of the two S's in my link, everything worked in ADE. I'm assuming it will look right on by 505, too - I'm off to test that now.

Thanks for the help!
Reply 

#9  Valloric 03-26-2010, 08:21 PM
Quote AbominableDavid
I think I've got it fixed - I didn't know capitalization was important.

I had this link in each of my chapters:
Code
 <link rel="stylesheet" href="../styles/style0001.css" type="text/css" />
The Folder/File structure in the zip file, though, was Styles/Styles0001.css.

Once I changed the case of the two S's in my link, everything worked in ADE. I'm assuming it will look right on by 505, too - I'm off to test that now.

Thanks for the help!
That actually sounds like a possible bug in Sigil. It should have updated the link.

Create an issue on the tracker with the file attached. Don't forget to add the "Private" label so only you and I can see it, since you've said your not comfortable with making it publicly available.
Reply 

#10  AbominableDavid 03-26-2010, 08:27 PM
I manually added the original link to the stylesheet - I didn't notice if Sigil did it or not. I don't really think it's a bug with Sigil, but I'll still create the issue if you still want me to.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register