![]() |
#16 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,866
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Your style would be: Code:
.svg_inline { display: inline-block; width: 100%; height: 4em; /* Or whatever height you wish */ margin: 1em 0; text-indent: 0; } Since the svg wrapper maintains the proportion of the image, to honor the height, it will add blank spaces to the picture. Last edited by RbnJrg; 09-29-2025 at 08:16 AM. |
|
![]() |
![]() |
![]() |
#17 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,866
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
The property "display: inline-block" is part of the css2.1 protocol and is honored by ADE 2.x. (I don't know any epub2 ereader that doesn't support display: inline-block; even CoolReader support it). All engines based on RMDSK support "display: inline-block". But OTOH, they don't support the property "max-width" and "max-height", that you include in your answer ("max-height: 4em; max-width: 100%"). That "solution" is not honored by ADE 2.x/3.x/4.x for an epub2 ebook (ADE 4.x will honor it only for epub3 ebooks).
Last edited by RbnJrg; 09-29-2025 at 08:30 AM. |
![]() |
![]() |
![]() |
#18 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,746
Karma: 109269703
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Indeed max-width or max-height are ignored by many epub2.
|
![]() |
![]() |
![]() |
#19 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,569
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
But I didn't say my "solution" was epub2-compliant
![]() For the record, here's the CSS properties supported by the epub2 spec: https://idpf.org/epub/20/spec/OPS_2....htm#Section3.3 display:inline-block is indeed not there, max/min-width/height are. So, one thing is ADE-2.x compliance, a quite different thing is epub2 compliance. Of course one could argue that the former more relevant ![]() |
![]() |
![]() |
![]() |
#20 | |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,746
Karma: 109269703
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Quote:
Do you only care about the W3C spec, or do you test on all the well known / popular browsers (and code for lowest common support), or just code for Chrome / Chromium based browsers and reinforce Google's attempt to control the "Web"? EDIT: And also there are things in all specs and maybe widely supported that might be stupid to use, simply because you can. |
|
![]() |
![]() |
![]() |
#21 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,569
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Personally, I use whatever works for me on my reader (KOReader, currently), and I try to make it spec-compliant. Then, if it doesn't work elsewhere, I can safely blame the reader (software)
![]() |
![]() |
![]() |
![]() |
#22 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 491
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
I'm curious, if this were epub3, would there be a perfect solution? Or does this kind of conditional formatting need to be defined at the OS/application level? |
|
![]() |
![]() |
![]() |
#23 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,866
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
preserveAspectRatio="xMidYMid meet" Code:
preserveAspectRatio="xMidYMid slice" Quote:
https://www.w3schools.com/css/css3_object-fit.asp Quote:
|
|||
![]() |
![]() |
![]() |
#24 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 491
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Sorry, I wasn't clear: I didn't want a stretchy image... but I also don't want white space on top and bottom, so I was saying I'd have to think about which one I want LEAST since a perfect solution in epub2 sounds impossible.
I looked at object-fit and it looks like scale-down is the value I'd need to use... except, from the description it looks like if it is forced to scale down, it created white space on top and bottom. Is that correct, or is that just a function of the example W3 chose? |
![]() |
![]() |
![]() |
Tags |
image height, image scaling |
|
![]() |
||||
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 |