View Single Post
Old 12-22-2014, 11:00 PM   #146
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by shamanNS View Post
Not sure what you mean when you write "reader's style sheet"? If you refer to "user agent style sheet" (= device/renderer defaults) then the "author style sheet" (= epub's css) has higher priority and overrides device defaults. Or are we talking about crappy mobile apps that are ignoring ebooks style sheet by abusing "!important"?
Yes, I mean the UA stylesheet. The author stylesheet has higher importance, true, but as I understand it, importance matters only for matching rules; they don't cause the author stylesheet's inherited values to be promoted higher than explicitly matching rules in the UA stylesheet.

Because your stylesheet doesn't provide any rules that match against the h1 tag (your body tag rule matches only on the body), and because the h1 tag's style has already been set to a value other than inherit by the UA stylesheet, that altered value from the UA stylesheet should win.

BTW, I just tested this using Safari, and that's the way it handles this conflict, which means it is very likely that every WebKit-based reader (including every KF8 reader, iBooks, etc.) is likely to handle it similarly.

The bottom line is that if you care about the font for a particular element, you must have at least one CSS rule that actually matches that element. If it is critical, be explicit.

The easiest way to fix it is probably to use "body, body *" instead of just body, but who knows how KindleGen will handle that.
dgatwood is offline   Reply With Quote