View Single Post
Old 09-05-2014, 03:32 AM   #6
paipa
Member
paipa began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Nov 2013
Device: Kindle Paperwhite 2
Quote:
Originally Posted by kovidgoyal View Post
extra css will not magically override styles defined in the input document. In this case, whatever styles are produced by the markdown converter. Only if a rule in extra css has higher specificity than a rule in the input document will it be applied.
I don't think I get what "specificity" means in this context. A selector such as h1 + p is more specific than everything else in the post-conversion CSS. If I add it to the CSS after conversion with the GUI editor, they are applied, the DO override the styles already present and the book looks fine. No "magic" is needed here.

I see that calibre doesn't ever use element selectors in the CSS, but creates classes that it assigns to elements (calibre1, calibre2, etc.) which I suppose is a limitation here unless it has the capability of computing all p tags that are preceded by h1, creating a .calibre567 class and explicitly assigning it to them.
paipa is offline   Reply With Quote