![]() |
#1 |
Connoisseur
![]() Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
|
How to margin p-Tag for PocketBook?
I wanna design for the PocketBook Reader app (iOS and Android) and keep struggling to set margins for paragraphs. Although PocketBook processes margins for div and some other tags properly, it refuses to apply my custom settings to p-tags. I've even raised precedence to almost maximum, but no satisfaction in sight...
HTML Code:
<p>First Paragraph</p> <p>Second Paragraph</p> Code:
p { margin: 3em 0; } ![]() Many thanks for any help, Slevin |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,764
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Last edited by RbnJrg; 07-05-2025 at 11:21 AM. |
|
![]() |
![]() |
![]() |
#3 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 196896
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
In general, it’s never a good idea to target a specific reader. EPUB is supposed to be a reflowing format that should work on all readers equally good.
But you can, of course—freedom of choice. ;-) |
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |||
Connoisseur
![]() Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
|
Quote:
![]() Quote:
I will try to contact PocketBook (again) and tell them friendly to fix their bug - although I think they would prefer to stay in the mindset that this is a feature. Quote:
That is the framework to build your own ebook reader, right? Well, this would definitely be a solution for a big publishing company, but we are just a bunch of normal people who wanna provide ebooks for our community, so all the challenges and difficulties which come with that (ie. releasing apps on the Apple app store) are not worth the effort. But thanks for the tip anyways. |
|||
![]() |
![]() |
![]() |
#6 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 196896
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
Just had a quick look, and tried your file on a Pocketbook Era, the Calibre Viewer, Foliate and Thorium. All behave the same (and rightly so), because your CSS in styles.css is at fault, not any of the readers.
Code:
body { font-family: "Literata", serif; } body > p.p { margin: 1em 0 !important; } body > .p1.p1 { margin: 3em 0 !important; } body > .p2.p2 { margin-top: 3em !important; margin-right: 0 !important; margin-bottom: 3em !important; margin-left: 0 !important; } Code:
body { font-family: "Literata", serif; } p { margin: 1em 0; background-color: white; /* remove when done */ } p.p1 { margin: 3em 0; background-color: white; /* remove when done */ } p.p2 { margin-top: 3em; margin-right: 0; margin-bottom: 3em; margin-left: 0; background-color: white; /* remove when done */ } /* Show what's happening */ body { background-color: lightgray; } p::before { content: '(P) '; } p.p1::before { content: '(P1) '; } p.p2::before { content: '(P2) '; } I don’t have any Pocketbook Apps here, but if they use the same (or at least a compliant) renderer in those apps, it should display the same. I’m not sure about iOS, Apple probably forces everyone to use their WebKit engine (from Safari), so for more special features you might have to use the -webkit-prefixes in addition there. Try to use as few as possible. Vendor-specific is evil. Like you say, we’ve had that with IE, back in the days. Hint: Try to start out with easy CSS, don’t overcomplicate it. Last edited by Moonbase59; 07-06-2025 at 04:11 AM. |
![]() |
![]() |
![]() |
#7 | ||
Connoisseur
![]() Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
|
Quote:
Quote:
I've written CSS for over 20 years and am still willing to learn more, although there is a reason I mostly developed backend: predictability ![]() Thank you and wish you a nice sunday Last edited by Slevin#7; 07-06-2025 at 04:33 AM. |
||
![]() |
![]() |
![]() |
#8 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 196896
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
Pity. Looks like Safari/WebKit are becoming the new IE… I know why I keep away from Apple’s golden-cage expensive lifestyle products with reduced functionality. Then again, you might have to cater for that audience, too…
Let us know about that, and Android, too. Same to you! |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
|
Can't say whether PocketBook uses the webkit engine or something else, but Apple Books (Apple's own reader) works as expected - and to be honest, it's one of the better ones.
What was I even thinking, that in 2025 all the silly differences would eventually converge and issues of this kind would only be known as anachronism... |
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,764
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
|
Well, then that seems to be the case with iOS too, where you can go for an alternative renderer as well - which renders ebooks the same ugly way ADE does.
|
![]() |
![]() |
![]() |
#12 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 196896
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
So it’s down to the least common denominator… Sometimes things just suck.
|
![]() |
![]() |
![]() |
#13 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#14 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#15 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,023
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to tag PDFs with Calibre for PocketBook 740? | eLDeus | Library Management | 7 | 07-01-2023 07:03 PM |
Bottom margin ignored when tag is enclosed within a Div and paragraph spans two pages | paperback | Viewer | 9 | 03-18-2023 02:02 PM |
Tag Mapper: Remove tag if another specific tag exists? | ownedbycats | Library Management | 2 | 07-23-2020 10:32 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |