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

08-29-2009, 04: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?


08-30-2009, 07:07 AM
None that I'm aware of, see the spec (

08-30-2009, 01: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 (, 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.

08-30-2009, 05: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 ( 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 files with this "trick".