View Single Post
Old 07-06-2025, 03:42 AM   #6
Moonbase59
Addict
Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.Moonbase59 ought to be getting tired of karma fortunes by now.
 
Moonbase59's Avatar
 
Posts: 223
Karma: 1000244
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;
}
I have made a little change, removed the unneeded !important, added some text at the beginning of the paragraph CSS and made the background lightgray and the paragraph background white, so you can more easily spot what’s happening here.

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) ';
}
The modified EPUB and CSS are in the attached ZIP for you to study. This version works nicely (and behaves the same) on all readers noted above. I also include actual screenshots from a Pocketbook Era, and from Foliate.

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.
Attached Thumbnails
Click image for larger version

Name:	scr0008.png
Views:	37
Size:	121.5 KB
ID:	216749   Click image for larger version

Name:	scr0009.png
Views:	35
Size:	93.2 KB
ID:	216750   Click image for larger version

Name:	P Margin Test_001.png
Views:	33
Size:	233.6 KB
ID:	216751  
Attached Files
File Type: zip Test Files.zip (3.1 KB, 32 views)

Last edited by Moonbase59; 07-06-2025 at 04:11 AM.
Moonbase59 is offline   Reply With Quote