|
|
#61 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 546
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
I wonder if this is a bug. |
|
|
|
|
|
|
#62 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,925
Karma: 9553607
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
It's not a bug, it's your code; the issue is originated by the font size employed in Readium. When the size is lower than 80% the text overlaps the image. In fact, the text overlaps the image even with a size of 100%, but because the white space that surrounds the image you can't see that. As I said, don't use "em" to set the height of the image. |
|
|
|
|
|
|
#63 |
|
Enthusiast
![]() Posts: 36
Karma: 10
Join Date: Feb 2026
Device: iPad
|
RbnJrg nailed it — em units for image height are a trap because they're tied to font size, which is the one thing every EPUB reader actively lets users override. Your 20em image renders at one size with the default font, then completely different when someone bumps it up or down.
In practice, the most reliable approach I've found for constraining image height is max-height with viewport units: Code:
max-height: 90vh; width: auto; height: auto; For older readers that don't support viewport units, max-height: 100% on the image with the parent container set to a percentage of the page height is the safest fallback. Not as precise, but at least it won't overlap text. The fundamental issue is that EPUB wants everything reflowable and relative, but images are fixed-ratio content. Anything font-relative (em, rem, ex) will always be unpredictable for images. |
|
|
|
|
|
#64 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 546
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
If so, why is it always full screen in my example? @RbnJrg - you say you got the code to replicate the effect, but what did you change from your previous attempt with the same code that appeared to be producing a normal image? Last edited by ElMiko; Yesterday at 05:20 PM. |
|
|
|
|
|
|
#65 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,925
Karma: 9553607
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
.autoIMG {
text-indent: 0;
text-align: center;
max-height: 32em;
margin: 0;
}
.autoIMGimage {
width: auto;
max-height: 32em !important;
margin: 0 auto;
display: block;
}
Quote:
|
||
|
|
|
|
|
#66 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 546
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
(Also, I meant what was changed from the first time you looked at it in the readium plugin (when it worked) and when you looked at my code straight up (which was failing), and it's the "!important"). |
|
|
|
|
![]() |
| Tags |
| image height, image scaling |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| line-height is fixed? | nano5 | Viewer | 5 | 01-25-2025 08:01 AM |
| Image height | JSWolf | KOReader | 6 | 03-29-2021 04:29 PM |
| QT5 and image height | Turtle91 | Sigil | 23 | 02-21-2013 01:44 PM |
| Image height in div | soparch | ePub | 5 | 03-29-2012 01:18 PM |
| What image height causes images to fill the screen? | karenbryant | ePub | 7 | 01-04-2012 04:23 AM |