View Single Post
Old 08-06-2025, 12:09 AM   #13
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,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by ElMiko View Post
...the epub file might require having functionally the whole book duplicated inside so that it could toggle your at-rule?
Yes, that is; mainly about how to handle images.

Quote:
Code:
<div class="epub3Code epub2Code">
   All the code for epub3 AND epub2 here...
</div>
No, no of that way. But you could have:

Code:
<div class="myStyle">
    Your elements/blocks to be formated here
</div>
and in your .css stylesheet:

Code:
.myStyle { /* here the style for epub2 */
   display: block;
   margin-top: 3em;
   etc...
}

@supports(display: flex) { /* if this is true, then we are under epub3 */
   .myStyle { /* Here the style to be applied on epub3 */
       display: flex;
       margin-top: revert; /* or margin-top: 0; you'll see what is better, depends on each case */
       etc...
   }
}
So, in this case, the XHTML code is the same for both, epub2 and epub3, BUT the .css is different.

Last edited by RbnJrg; 08-06-2025 at 12:12 AM.
RbnJrg is offline   Reply With Quote