EPUBCheck CSS-006: CSS fixed positioning
Updated:
EPUBCheck CSS-006 is a usage message: “CSS selector specifies fixed position.” A CSS rule uses position: fixed, which reading apps handle inconsistently in paginated text. It is a usage note, not an error: the element may stay on screen, disappear or overlap the text depending on the app.
The official message
CSS selector specifies fixed position.
- Default severity
- Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
- EPUBCheck version
- 5.4.0
Typical causes
- Styles copied from a website, such as fixed headers, footers or navigation bars.
- Fixed positioning used to place a page number or logo on every screen.
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 position: fixed or replace it with normal flow (position: static or relative).
- If the element was web navigation, remove it from the book: reading apps provide their own.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the property is direction or unicode-bidi, it is forbidden outright and reported as CSS-001.
Terms used here
Other CSS messages
CSS-005Conflicting alternate style tags found: ….CSS-007Font-face reference "…" refers to non-standard font type "…".CSS-004CSS documents must be encoded in UTF-8, detected …;CSS-008An error occurred while parsing the CSS: ….CSS-003CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.CSS-002Empty or NULL reference found.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.