View Single Post
Old 01-26-2017, 05:00 PM   #28
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,380
Karma: 145488914
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by nabsltd View Post
And, as others have noted, some reader software doesn't support the shorthand, while I have never found one that supports the shorthand but not the long version. Using the long version creates more portable EPUB.

On the other hand, I would never put any margin, widow, or text-align in type selector in an EPUB stylesheet. Those belong in the user stylesheet, so they can set their defaults for the reader they use, and don't have to resort to using "!important", which makes the cascade much harder to follow for humans. In fact, the EPUB stylesheet should really only have class, ID, and pseudo-element selectors.

Basically, CSS in an EPUB should always assume the user page box is how the user wants it, and not try and change it in any way. The CSS in the EPUB should use margins to separate the blocks of the book from the edges of the user page box, and to separate boxes from each other (either vertically or horizontally), and nothing else.
There is no such thing as a user stylesheet. It's just the ePub stylesheet. The "box" as you call it should be setup the best way possible so the options in the reading software can be used to set things how the user wants. Overall margins should be set to 0 so if the user wants to keep them that way, that can be done or if the user wants to increase the margins with the programs options, that can be done. Also, the base font size should be left at the default so the user can change it as wanted. A lot do find the default size to be good.

The one thing that cannot be changed in all reading programs is the indent or paragraph spaces. So it's best to have an indent of 1.2em and no paragraph space. Don't use a smaller font for things like offset text. What can be changed when there are options to change things is the font, the left/right margins, & line height. Some programs have more options but you have to go with the minimum and let these other programs do the overriding.

Don't use fixed values in CSS. Use em and % as needed. Don't use font-family unless you need to such as sans-serif or monospace. Make it as simple as possible. Don't have excess CSS entries that aren't used.
JSWolf is offline   Reply With Quote