View Single Post
Old 06-26-2025, 12:07 PM   #13
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,960
Karma: 146918083
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 Slevin#7 View Post
Can you please tell me, where the code is wrong? It passes the epub check and works well in Sigil, Calibre and other readers.

Regarding the px to hide the checkbox, it doesn't matter which size the screen has, it's just a big value to place the checkbox way out of the viewport. Values of -100/-100 should work as well, as long as there is no relative parent along the way up to the body element.
Code:
.toggle-answer {
  cursor: pointer;
  /* prevent accidentally selecting */
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;   
}

/* hide the checkbox, not a must for functionality */
.checkbox-answer {
  position: absolute;
  top: -1000px;
  left: -6000px;
  width: 0;
  height: 0;
  opacity: 0;
}
for toggle-answer, none of code being used is ePub compatible. For checkbox-answer, your px values are way too large.
JSWolf is online now   Reply With Quote