Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2026, 08:29 PM   #1
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 559
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
CSS compatibility width: fit-content

Is there any chance of getting KOReader to accept the width: fit-content property/value?
ElMiko is offline   Reply With Quote
Old 04-16-2026, 10:25 PM   #2
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 559
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
Nothing?

I'm really struggling to understand what CSS elements and properties are compatible with KOReader, and why. I have yet to find a program that reliably gives the user as much control over his/her reading experience as KOReader, but the advanced CSS formatting that it interprets versus that which it ignores is a black box. I understand (and, frankly, align with) the reticence to make KOReader integrate the multimedia elements of ePub3 design, but I am left puzzled by what appears to be an abitrary implementation of modern HTML formatting.

Is there at least any sort of reference guide for what works in KOReader and what doesn't? And what (if any) additional HTML/CSS functionalities are likely to be incorporated?
ElMiko is offline   Reply With Quote
Advert
Old 04-17-2026, 07:01 AM   #3
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,819
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
https://wiki.mozilla.org/QA/Minimal_Test_Cases

fit-content is already supported, so without a minimal testcase there isn't really anything to say.

Quote:
I am left puzzled by what appears to be an abitrary implementation of modern HTML formatting.
The fact that Netsurf is quite similar in end result suggests it's closer to inevitable than arbitrary.

Quote:
Is there at least any sort of reference guide for what works in KOReader and what doesn't? And what (if any) additional HTML/CSS functionalities are likely to be incorporated?
Mainly https://github.com/koreader/crengine...t.cpp#L38-L315

As for what would be added, basically whatever piques someone's interest. Doing preparatory work like providing minimal testcases increases the pique factor.
Frenzie is offline   Reply With Quote
Old 04-17-2026, 08:43 AM   #4
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 559
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
Quote:
Originally Posted by Frenzie View Post
https://wiki.mozilla.org/QA/Minimal_Test_Cases

fit-content is already supported, so without a minimal testcase there isn't really anything to say.
Sorry, the Google AI overview (which we all know has never been wrong) reported that fit-content is not well-supported by KOReader, which seemed to confirm my personal experience, prompting the original post. I've attached a sample epub file with the replicated code that is getting jammed up in KOReader.

The goal is to have a block of text that is centered in the page but with its contents variably aligned within that block, and constrained by the width of its contents [see FitContentCORRECT.jpg].

Unfortunately, in KOReader, it seems to be ignoring the fit-content value and occupying the full width of the screen (excluding the 5% L/R padding). [see FitContentWRONG.jpg]
Attached Thumbnails
Click image for larger version

Name:	FitContentCORRECT.jpg
Views:	10
Size:	42.8 KB
ID:	222621   Click image for larger version

Name:	FitContentWRONG.jpg
Views:	10
Size:	45.6 KB
ID:	222622  
Attached Files
File Type: epub FitContent.epub (2.3 KB, 6 views)

Last edited by ElMiko; 04-17-2026 at 08:46 AM.
ElMiko is offline   Reply With Quote
Old Today, 03:58 AM   #5
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,819
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
It looks like the "correct" screenshot for me. You're most likely using an old version or you've changed some render setting.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20260419_095253.png
Views:	10
Size:	86.9 KB
ID:	222672  
Frenzie is offline   Reply With Quote
Advert
Old Today, 09:13 AM   #6
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 559
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
Quote:
Originally Posted by Frenzie View Post
It looks like the "correct" screenshot for me. You're most likely using an old version or you've changed some render setting.
Thanks for looking into this @Frenzie.

I updated and now am getting something similar to what your seeing, but it's still not actually "fitting to content". As you can see from your screenshot, the lines are breaking when they shouldn't be—the "padding" is way more than 5% on either side.

EDIT: I think I see what's happening... It's applying the padding after the fit-content, so the content will always render as less than its full width. Presumably, setting the padding to zero and wrapping the whole element in a div with 5% L/R margins will get around this, right?

EDIT2: Okay, so there are two approaches here that would work, I think. One is the div wrap, which would be most useful with absolute value margins (e.g. 2em). The other is a max width property within the blockquote itself, which would be most useful for relative boundaries.

Last edited by ElMiko; Today at 11:03 AM.
ElMiko is offline   Reply With Quote
Old Today, 01:29 PM   #7
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,819
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
More in https://github.com/koreader/crengine...on_r3107195648
Frenzie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
css if img aspect-ratio >1/1 width:100%, otherwise width:50% rjwse@aol.com Editor 0 03-19-2021 07:41 AM
fit a image to the width of screen leescott ePub 7 07-23-2015 10:39 AM
K3 - Fit to screen (width) for PDF nuke Amazon Kindle 0 09-30-2010 09:27 AM
How to center/fit page width SVG images with <OBJECT> amoroso ePub 0 07-31-2010 11:48 AM
PRS-600 How to make prs600 display PDF fit width? wifish Sony Reader 1 12-20-2009 12:28 PM


All times are GMT -4. The time now is 05:55 PM.


MobileRead.com is a privately owned, operated and funded community.