View Single Post
Old 04-21-2016, 06:40 AM   #18
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by SJC-Caron View Post
Anyone care to expand on the use of the !important tag in epubs/kepubs? Thanks.
!important in the ePub reader only overrides the style in the specific class it is used in, but in the KePub reader it also overrides the style in its subclasses.

As an example:
Code:
body { line-height: 1.1 !important; }
In the KePub reader this will override the line-height in subclasses of body such as body.calibre, but not in the ePub reader.

This becomes a problem when converting books with Calibre, because if there is a style like this in the original book:
Code:
body { line-height: 1.2; }

<body>
the converted book will be changed by Calibre to:
Code:
.calibre { line-height: 1.2; }

<body class="calibre">
and so when the ePub reader tries to override the line-height with !important, it will no longer have any effect in the converted book, although it worked correctly in the original book.However the KePub reader will still be able to override the style.
GeoffR is offline   Reply With Quote