CSS features not in EPUB

From DPWiki
Jump to navigation Jump to search

Here is some detail on what CSS features are not supported in EPUB.

This is based purely on a comparison between the CSS2 spec dated May 12, 1998, and the Open Publication Structure (OPS) 2.0 v1.0 dated September 11, 2007. I did not conduct any experiment whatsoever.

@media

only "aural" and "all" are supported ("screen", "print", "handheld" and so on are not)

border-style

Values other than "hidden" and "none" may all be displayed as "solid" (in other words, there's no guarantee that the reader displays dotted or dashed line in a different manner as solid lines).

display

Values "list-item", "compact", "marker" are not supported. (Does not seem to be used at all in our html?)

position

Not supported (has an impact on our usual handling of page numbers, and perhaps some footnote labels).

top, right, bottom, left

Not supported (they are used in conjunction with position).

z-index

Not supported (used for layers? Does not seem to be used at all in our html?).

vertical-align

Values <percentage> and <length> are not supported (That may impact some of our CSS for <sup> and for footnote anchors).

overflow, clip, visibility

Not supported (should not be an issue).

:before and :after

Not supported (should not be an issue).

quotes

Not supported (should not be an issue: this doesn't work satisfactorily in the main browsers anyway).

counter-reset, counter-increment

Not supported (should not be an issue, imho using that in our ebook looks like asking for trouble).

marker-offset

Not supported (should not be an issue).

list-style-type

Esoteric values other than based on the latin alphabet (e.g. "lower-greek", "georgian", "hiragana"...) may be replaced by "Decimal". (Extremely unlikely that it be an issue for us).

list-style-image

Not supported (Might only slightly alter the prettiness of specially decorative books?).

size, marks, page

Not supported (No effect for us, this is used purely to specify paper sizes when printing).

background-image, background-repeat, background-attachment, background-position

Not supported (This will be an issue with some complex illustrated books, or some decorative dropcaps).

font-family

The generic names "cursive" and "fantasy" are not supported. (This shouldn't be a major issue, since generally the usual browsers are so poor in displaying these font families that it should be rarely used.)

font-weight

Values "bolder" and "lighter" are not supported (Somewhat unlikely to be an issue for us) .

font-stretch, font-size-adjust

Not supported (Font tuning is discouraged by PG anyway, not an issue).

font

Not supported (this is used to refer to system fonts used in the menus, captions, and so on; that should definitly not be used in our HTML).

@font-face

Not supported (used to download additional fonts, which is contrary to the PG guidelines).

text-align

The value "<string>" is not supported (used for special effects in tables, should not be an issue).

text-decoration

Values "overline" and "blink" (Good heavens!) are not supported. ("overline" might be an issue for some special cases like math formulae or other weird notations; "blink" is not an issue).

text-shadow

Not supported (should not be an issue, decorative only).

letter-spacing, word-spacing

Not supported (A major issue for gesperrt text, as it loses author's intent).

Note minstrel: This is one of the reasons why I suggest to style <em class="gesperrt"> for marking up gesperrt text as explained in Post-Processing German books. If the letter-spacing doesn't work, the <em> will fall back to its default behavior, and the marked-up passage will still be emphasized, as intended by the author.
Alas no, using <em> is good but does not solve the issue. While the <em> will remain theoretically emphasized (for instance it would still stand out in a speech reader), the usual CSS definition, font-style: normal; font-weight: normal; will prevent that emphasis to be visible on screen, as the text will displayed as normal text (no italics, and no bold). One would need to create another CSS definition for EPUB.

text-transform

Not supported (might have a minor effect for decorative first words of a chapter).

border-collapse, border-spacing, empty-cells

Not supported (This is used to have a better control on the display of borders inside tables; should not have semantical effects).

cursor, outline-color, outline-width, outline-style, :focus, :active

Not supported (Seldom use, or decorative only: should not be an issue).

play-during, azimuth, elevation, pitch-range

Not supported (Not an issue: does anyone use aural style sheets anyway?).