![]() |
#16 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
https://www.joshwcomeau.com/css/height-enigma/ |
|
![]() |
![]() |
![]() |
#17 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,564
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
It's not a bug in ADE 2/3. They both work with SVG and they both work with the code I posted for a full screen image. In previous versions of calibre and Sigil, they did display % correctly. But that was until a change in QT quashed that. So we just have to see the images not correct in the previewers. But it does work properly in ADE 2/3, calibre viewer, Kindle with KF8, Kobo with ePub & KePub. Last edited by JSWolf; 06-10-2025 at 01:57 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
BUT IF YOU HAD READ THE ARTICLE, then you would know that what you're calling a bug isn't one, and that the correct way to deal with percentage heights is to include the following in the stylesheet: Code:
html, body { height: 100%; } Code:
.myFullHeight { height: 100%; /* ADE will work with this and will work because of the ADE's bug */ } @supports (height: 99vh) { /* and QT ereader will use this; ADE will ignore this statement */ .myFullHeight { height: 99vh; } } Temporal.epub The same problem occurs when setting the height using the alternative method (see the following epub): Temporal2.epub But by employing a svg wrapper all problems disappear: Temporal3.epub Of course, you're free to continue using your own code (even if it's not the best), but you're leaving out more than half of e-readers. Last edited by RbnJrg; 06-10-2025 at 05:37 PM. |
||
![]() |
![]() |
![]() |
#19 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,719
Karma: 168959600
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
#20 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
You are welcome! Indeed, the article not only describes very well how to use the "height" property (which is handled very differently than the "width"), but it's very modern and also teaches how to combine "height" with "grid" and "flex-box." It's funny because what JSWolf thinks is a bug is actually the normal behavior of the "height" property, and it's ADE that doesn't handle it properly.
|
![]() |
![]() |
Advert | |
|
![]() |
#21 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
I'm still unclear in one of your latest example codes: Code:
html, body { height: 100%; } Regarding the Sigil plugin that should allow me to turn off my already addled brain, is it the "InsertImageSVG" plugin? EDIT: I just reread that Josh W. Comeau article again, and I feel the need to curse again in total awe. Genuinely eye-opening. Last edited by ElMiko; 06-11-2025 at 10:20 AM. |
|
![]() |
![]() |
![]() |
#22 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Quote:
![]() Quote:
|
|||
![]() |
![]() |
![]() |
#23 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,564
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The reason it doesn't work in Sigil's or calibre's preview is becuase of a bug in QT that doesn't respect %. |
|
![]() |
![]() |
![]() |
#24 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
1. In your .css stylesheet: Code:
img { width: 100%; } Code:
<div> <img alt="" src="../Image/your_image.jpg" /> </div> Code:
html, body { height: 100%; } |
||
![]() |
![]() |
![]() |
#25 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,524
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Your "bug" theory has been completely and competently disproven, Jon. Any further attempts by you to pretend everyone else (including experts in the field) "is wrong" are going to be deleted. Your petty coding vendettas will not be tolerated here. Take it somewhere else.
|
![]() |
![]() |
![]() |
#26 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
@ RbnJrg -- yeah, so setting html and body to 100% only works for an image (or, really, anything) that is intended to fit ONLY one page, right? If one were to insert the image amidst a whole chapter's worth of text, would it force all the text to fit in a single "screen" too?
|
![]() |
![]() |
![]() |
#27 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
a) In your .css stylesheet: Code:
.myHeight { height: 100%; /* ADE will work with this and will work because of the ADE's bug */ } @supports (height: 99vh) { /* and QT ereader will use this; ADE will ignore this statement */ .myHeight { height: 99vh; } } Code:
<div class="myHeight"> <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 XXX YYY" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <image height="YYY" width="XXX" xlink:href="../Images/cover.jpg"/> </svg> </div> In epub3 the situation is distinct. You can force the image to float vertically, thus avoiding any white space because the space generated by the image's movement is occupied by text. But the code to achieve this is a bit different from the code used in epub2. |
||
![]() |
![]() |
![]() |
#28 |
Connoisseur
![]() Posts: 73
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
|
Setting the height to 99vh for the div is the only way I can make it work on the Tolino Shine 5.
Not using a div and simply setting it in the svg seems to work fine in Thorium, Apple Books and Calibre’s ebook viewer. |
![]() |
![]() |
![]() |
#29 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Not using a div to enclose the svg wrapper? What is the output of epubcheck in your epub?
Last edited by RbnJrg; 06-14-2025 at 09:34 AM. |
![]() |
![]() |
![]() |
#30 |
Connoisseur
![]() Posts: 73
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
|
No idea, I can't get the sigil plugin to work.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS Styling based on class/existing styling | 1ily | Calibre | 8 | 03-17-2025 06:37 AM |
Incorrect styling with specific CSS | quiris | Marvin | 9 | 07-04-2016 01:04 PM |
Missing CSS properties | roger64 | KOReader | 0 | 06-01-2016 06:39 AM |
inspect image properties /replace image | cybmole | Sigil | 6 | 02-05-2013 12:46 PM |
Unsetting properties in CSS | Jellby | ePub | 2 | 06-03-2009 04:29 AM |