View Full Version : Any way to assign different styles to web pages vs. epub


richieadler
08-29-2009, 03:55 PM
Is there some type of selector or media which can be used to show a different style when a page is shown in a browser and when is part of an ePub and read by an eBook device?

:thanks:

Jellby
08-30-2009, 06:07 AM
None that I'm aware of, see the spec (http://www.idpf.org/2007/ops/OPS_2.0_final_spec.html#Section3.3).

Ankh
08-30-2009, 12:08 PM
When it comes to standard ePub format, Jellby's reply stands, spec does not allow for it.

However, due to the widespread use of ADE on dedicated ebook readers, there is a possibility to use one of their their proprietary extensions. Details are available in Adobe's EPUB Best Practices Guide (http://www.adobe.com/devnet/digitalpublishing/epubs/EPUBBestPractices-1_0_3.epub), chapter "Adobe Extensions", section "Layout Template/Dynamic styling".

It is not part of the standard, nor it is trivial to implement. Other ePub renderers should ignore that extension, but it is better to test such a publication against as many ePub viewers as it is possible.

Jellby
08-30-2009, 04:38 PM
But if it's for your own use (to test ePUBs in a browser, for instance), you can use something like what I posted here (http://www.mobileread.com/forums/showthread.php?t=51267). The basic trick is using javascript to load additional .css files in the browser. In that thread it's a bit hidden, but you can also check one of my ePUB uploads (not the latest ones), where I provide index.zip files with this "trick".