EPUBCheck CSS-005: conflicting style tags
Updated:
EPUBCheck CSS-005 is a usage message: “Conflicting alternate style tags found: ….” A link to a stylesheet carries alternate style tags that contradict each other. Alternate style tags are class names on link elements (horizontal or vertical, day or night) that tell a reading app when to use each stylesheet, and EPUBCheck lists the conflicting ones.
The official message
Conflicting alternate style tags found: %1$s.
- 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
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- One link element tagged both day and night, or both horizontal and vertical.
- Class lists merged from two templates without checking them.
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.
- Keep one tag of each pair on each link element, for example
class="night". - If you need styles for both cases, use two link elements, each with its own tag and title.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If an alternate style sheet simply has no title, the message is CSS-015.
Terms used here
Other CSS messages
CSS-004CSS documents must be encoded in UTF-8, detected …;CSS-006CSS selector specifies fixed position.CSS-003CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.CSS-007Font-face reference "…" refers to non-standard font type "…".CSS-002Empty or NULL reference found.CSS-008An error occurred while parsing the CSS: ….
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.