Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 02:49 PM   #16
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,612
Karma: 145864263
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
It is ePub compatible if the renderer is ePub compliant. ePub renderers are required to ignore bad/non-supported css gracefully...

If ePubcheck doesn't complain about it, neither should you.


Do you happen to have a suggestion to make it work, rather than simply telling people it won't work??
Code:
.toggle-answer {
  /* prevent accidentally selecting */
  display: none;
}
For the other, to decide what code to use, we'd need to what the class is doing in the HTML.
JSWolf is offline   Reply With Quote
Old Yesterday, 03:17 PM   #17
Slevin#7
Enthusiast
Slevin#7 began at the beginning.
 
Posts: 38
Karma: 10
Join Date: May 2025
Device: iPad
Quote:
Originally Posted by JSWolf View Post
Code:
.toggle-answer {
  /* prevent accidentally selecting */
  display: none;
}
For the other, to decide what code to use, we'd need to what the class is doing in the HTML.
What do you mean to accomplish by that? With 'display: none;' you are hiding the label which serves two purposes: first it tells the user where to click and second it is REQUIRED to being clicked on to show the answer. If the checkbox would be visible (which is currently hidden), one could click on the checkbox itself, but you have at least to provide a description.

Also, I'm pretty sure 'cursor: pointer;' which you deleted as well is proper CSS.

And since you stripped the code which should prevent selecting text by accident comepletely, the comment is obsolete - however, I would at least keep 'user-select: none;', this is without any vendor prefix proper code, but maybe not sufficient for all kind of render engines.
Slevin#7 is offline   Reply With Quote
Old Yesterday, 04:21 PM   #18
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,345
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
You also need to remember that not all css has been adopted into ePub standards. What works on a web page isn’t necessarily supported in an ebook.

My comment above was simply to show that just because some css doesn’t work in an epub doesn’t mean it is going to break the book if it is included. The epub is required to gracefully ignore css that it doesn’t support. So you can use all that css if you wish, it just isn’t guaranteed to work and you need to provide coding it can use as a fallback option.
Turtle91 is online now   Reply With Quote
Old Yesterday, 05:16 PM   #19
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,726
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by robertmchicago View Post
Thanks a lot for the suggestion!
I already have tested these codes:
page-break-after: always;
break-after: always;
They work in Kindle Previewer and ADE 2.0, but not in Kobo Desktop.
Kobo Desktop? Who reads in Kobo Desktop nowadays? It's the worst desktop ereader, riddled with bugs. If you buy a Kobo ebook is because you have a Kobo physical device. So if that's your concern, forget about Kobo Desktop and use the solution Turtle91 gave you, forcing page-breaks with:

Code:
<p class="answer">Answer to question #x</p>

.answer {
  page-break-after: always !important;
  break-after: always !important;
  -moz-column-break-after: always !important;
  -webkit-column-break-after: always !important;
}

Last edited by RbnJrg; Yesterday at 05:19 PM.
RbnJrg is online now   Reply With Quote
Old Yesterday, 05:17 PM   #20
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,612
Karma: 145864263
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
You also need to remember that not all css has been adopted into ePub standards. What works on a web page isn’t necessarily supported in an ebook.

My comment above was simply to show that just because some css doesn’t work in an epub doesn’t mean it is going to break the book if it is included. The epub is required to gracefully ignore css that it doesn’t support. So you can use all that css if you wish, it just isn’t guaranteed to work and you need to provide coding it can use as a fallback option.
Unless you are using an older version of ADE/RMSDK in which case, CSS if feels is wrong, it will toss out all of the CSS.
JSWolf is offline   Reply With Quote
Old Yesterday, 05:22 PM   #21
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,612
Karma: 145864263
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by RbnJrg View Post
Kobo Desktop? Who reads in Kobo Desktop nowadays? It's the worst desktop ereader, riddled with bugs. If that's your concern, forget about Kobo Desktop and use the solution Turtle91 gave you, forcing page-breaks with:

Code:
<p class="answer">Answer to question #x</p>

.answer {
  page-break-after: always !important;
  break-after: always !important;
  -moz-column-break-after: always !important;
  -webkit-column-break-after: always !important;
}
The correct CSS code for ePub is
Code:
.answer {
  page-break-after: always;
}
You don't need !important. Also, ePub is not a browser so the other code is not needed/valid.
JSWolf is offline   Reply With Quote
Old Today, 12:11 AM   #22
robertmchicago
Enthusiast
robertmchicago began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Apr 2025
Device: none
Quote:
Originally Posted by Doitsu View Post
You could also simply format your answers as footnotes in an epub3 book. If you use the generic footnote code in the Kindle Publishing Guidelines and the Apple Books Asset Guide 5.3.1, the answer will be shown as a popup.

Thanks for the suggestion & links! Using the footnote feature is a smart idea. I also thought about that. But about 150 of my answers have both text and images. Many of the images have width=1250px. I know that some eReaders show footnotes in a small popup, so I don’t think they will show the full answer with image properly
robertmchicago is offline   Reply With Quote
Old Today, 12:15 AM   #23
robertmchicago
Enthusiast
robertmchicago began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Apr 2025
Device: none
Quote:
Originally Posted by RbnJrg View Post
Kobo Desktop? Who reads in Kobo Desktop nowadays? It's the worst desktop ereader, riddled with bugs. If you buy a Kobo ebook is because you have a Kobo physical device. So if that's your concern, forget about Kobo Desktop and use the solution Turtle91 gave you, forcing page-breaks with:

Code:
<p class="answer">Answer to question #x</p>

.answer {
  page-break-after: always !important;
  break-after: always !important;
  -moz-column-break-after: always !important;
  -webkit-column-break-after: always !important;
}
Thanks for sharing your thoughts.
You’re right. I don’t need to worry too much about Kobo Desktop if page breaks are working fine in other apps. So I’ll use page breaks.
But I was also thinking of giving a kind of "fallback", just in case page breaks don’t work on someone’s device or app.
Here’s my 2-step fallback idea:
(1) Mix the order of the answers.
(2) Add the same lines of text 3 or 4 times between every two answers.

So for example, when someone clicks "show answer" for question 47, and page breaks are not working for their device or app, they will see something like this:

To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
=====================
Answer 47. Yes, the sky is blue.
"Go to Question"
=====================
To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
=====================
Answer 382. It is not a table.
"Go to Question"
=====================
To go back to the question, please click on "Go to Question".
Don’t flip pages forward or backward, you might see other answers that you don’t want to see yet.
robertmchicago is offline   Reply With Quote
Reply

Tags
100vh, code, epub, margin, space


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB2 vs EPUB3 langshipley ePub 4 01-13-2023 06:47 PM
[Plugin] epub2 output Doitsu Plugins 11 12-01-2021 04:17 PM
Hiding endnotes after the last page of an epub2 HHJT ePub 52 02-27-2018 08:09 PM
epub3 to epub2 AlanHK Sigil 11 08-09-2017 05:06 AM
EPUB2 and the DOCTYPEgate roger64 ePub 21 07-18-2014 07:49 PM


All times are GMT -4. The time now is 10:02 PM.


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