![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 2000
Join Date: Dec 2010
Device: none
|
Odd discovery fixed all my centering issues
I'm posting this because I had never found a solution to my problems with centering and other non-working style issues--until today! I set out to find a hack solution to get a line of text to center because, no matter what I'd tried, it would not be centered on my Nook (I thought it was the Nook reader app and how it handled CSS..which in a way it is!) In testing with Sigil, I stumbled, quite by accident, across what had been my whole problem, so I'm hoping this might also solve some problems others may be having. The point is that everything looked perfect in Calibre, Sigil, in a browser, all programs that ran on my pc--but on my color Nook it all went left aligned.
The problem, after a lot of testing, turned out to be one messed up line in the stylesheet. To clarify, I do not build stylesheets by hand, and rarely thought to look at it closely; I use Dreamweaver for editing the xhtml and let DW generate the CSS stylesheet file. I guess it's perfect 99.99% of the time...but.. In one tag in one line of the CSS file there was a glitch where the ending em; (that's the size measurement and closing quote) was on a different line beneath where it should have been. I'll insert images below. I proved this was the problem by testing with just the two entries. When I fixed the error by moving the ending em;...problem solved. Actually, fixing a couple of other similar glitches resolved a whole host of other issues too, which suggests to me that wherever a problem like this occurs, it kills all subsequent tags. After manually going through the template.css file and cleaning up this kind of glitch...my book looks wonderful now. The standard span entry, or just a text:center will line things up fine. So, if you're having weird problems, do scroll through your stylesheet and check for misaligned or disconnected spots. Anyway, see the images below for before and after results, and picture showing the problem CSS tag (at the top of the picture.) ![]() ![]() ![]() ![]() ![]() Fwiw, this now displays perfectly on my color Nook using the built-in reader app. I've also tested it using fbReader app, which is a nice app but apparently doesn't use the stylesheet. Nevertheless, since you can now double-tap to zoom in on images with the latest Nook update, things are working well all the way around. -JT |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
FWIW
Adobe Digital Editions is also intolerant of any error and will ignore the entire style. ![]() you can validate your stylesheet here: http://jigsaw.w3.org/css-validator/#validate_by_upload ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
I don't think the problem is that the em is in a new line.
The problem is that the line before (font-size: 1) does not end with a semicolon. |
![]() |
![]() |
![]() |
#4 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
|
Quote:
The semi-colon isn't required on the last line of the style, but you do need to close it. |
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
|
Hmm didn't fully read the first entry here, please ignore my previous comments.
Looking at the css, I'm not really seeing the problem, aprat from it showing it as ".em". Maybe the reader was thinking that the entry was the start of a new style and thought the styles were malformed? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Hmm, I think my comment did not make too much sense...
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
|
|
![]() |
![]() |
![]() |
#8 |
Berti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
I guess, it would be a good idea that Sigil (or the built-in epub-validator) would make some simple checks on css, so that missing colons, semicolons, brackets will never cause a problem again. Maybe at 0.7.0 ?
|
![]() |
![]() |
![]() |
#9 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
|
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2011
Device: iPad, Kindle
|
CSS does not allow anything between the number and the unit of measurement. So it must be "1em" and not "1 em" or anything else in-between. The extra line break was between them.
|
![]() |
![]() |
![]() |
#11 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
For the love of heaven, people...
The Nook (or ADE, etc.) thought that the ".em" was a new STYLE. That's all. Just like any other class style decoration that starts with a "." That's it, no big mystery. It would have ignored everything after that as being malformed because the ending brackets were missing from the previous style (if you try reading this line-by-line, as a device would) and the opening brackets were missing from "style .em" That's all. The return, occuring before the ".," caused the ruckus. Hitch |
![]() |
![]() |
![]() |
#12 | |
book creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centering blockquotes | ghostyjack | ePub | 6 | 07-17-2014 06:07 AM |
Nook not centering anything. why? | kateharp | ePub | 0 | 05-11-2011 10:53 PM |
Centering Images using object styles | SamL | ePub | 7 | 04-05-2011 01:28 PM |
Centering PDF | nguirado | Amazon Kindle | 5 | 10-04-2010 08:45 PM |
How to do centering | sjohnson717 | Calibre | 15 | 02-28-2010 09:20 AM |