EPUBCheck CSS-001: forbidden CSS property
Updated:
EPUBCheck CSS-001 is an error message: “The "…" property must not be included in an EPUB Style Sheet.” The stylesheet uses a property that EPUB does not allow in its style sheets. EPUB 3.3 forbids direction and unicode-bidi in CSS, because reading apps may switch CSS off and the text direction would then be lost; EPUBCheck names the property.
The official message
The "%1$s" property must not be included in an EPUB Style Sheet.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- CSS copied from the web that sets text direction in the stylesheet.
- Right-to-left books (Arabic, Hebrew) where the direction was put in CSS instead of the markup.
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Remove the direction or unicode-bidi declaration from the stylesheet.
- Set text direction with the dir attribute in the XHTML instead, for example
<html dir="rtl">or<p dir="ltr">, and use bdo for bidirectional overrides. - For right-to-left page turning, set page-progression-direction on the spine.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the CSS cannot be parsed at all, the message is CSS-008.
Terms used here
Other CSS messages
CSS-002Empty or NULL reference found.CSS-003CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.CSS-004CSS documents must be encoded in UTF-8, detected …;CSS-005Conflicting alternate style tags found: ….CSS-006CSS selector specifies fixed position.CSS-007Font-face reference "…" refers to non-standard font type "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.