10-23-2019, 03:44 AM | #1 |
Member
Posts: 11
Karma: 10
Join Date: Oct 2019
Device: Kindle Paperwhite 7th gen
|
CSS Style Question
I'm using the scrolling view mode of the Calibre viewer, with
Code:
body.calibre-viewer-scrolling { margin-left: 300px !important; margin-right: 300px !important; } However, the images included in the epub appear very small with an ident of their own—even though through the View Image function they are of very large size. I tried using the code: Code:
body.calibre-viewer-scrolling.img { width: 100%; !important; height:100% margin-left: 0px !important; margin-right: 0px !important; } Thank you! |
10-23-2019, 05:02 AM | #2 |
creator of calibre
Posts: 44,653
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the inspector tool to check what CSS is applied to the image to figure out why it is displayed small.
|
Advert | |
|
10-23-2019, 10:42 AM | #3 |
Member
Posts: 11
Karma: 10
Join Date: Oct 2019
Device: Kindle Paperwhite 7th gen
|
While using the inspector, i found out that the epub had fixed image resolutions assigned to each image.
Code:
<img height="337" width="480" src="../Images/image03297.jpeg" alt="" data-calibre-src="OEBPS/Images/image03297.jpeg"> Code:
<p class="image"> Last edited by Enterio; 10-23-2019 at 10:47 AM. |
10-23-2019, 01:12 PM | #4 |
creator of calibre
Posts: 44,653
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Add !important like this
img { width: 100vw !important; } note the semi-colon comes after important not before it |
10-24-2019, 04:16 AM | #5 |
Member
Posts: 11
Karma: 10
Join Date: Oct 2019
Device: Kindle Paperwhite 7th gen
|
This stretches the images to the full screen, which is not what I wanted.
I'd need the images to ignore all the inheritance rules before them, and set them to: Code:
width:auto !important; height:auto !important; Also, could there be an option to save the assigned style modifications as a part of each book? (i.e., when I open Book (1) I'll have style (1) and when I open Book (2) I'll have Style (2)), or is that too hard to implement? Thank you for your support! |
Advert | |
|
10-24-2019, 05:29 AM | #6 |
creator of calibre
Posts: 44,653
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
So do that. You can put whatever styles you want. And if you want to modify styles per book then do an EPUB to EPUB conversion and use the extra css setting in the conversion dialog to do that.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get same style of css for all books in one series | 3n4n | Editor | 5 | 10-06-2019 05:21 PM |
Custom style names in CSS | flipsake | Conversion | 0 | 11-30-2013 10:09 AM |
CSS style, TOC and other stuff | sebdea | Sigil | 8 | 04-19-2011 04:40 AM |
list-style in CSS? | frabjous | ePub | 2 | 08-13-2009 07:28 PM |