Skip to content
EPUBCheck · Stylesheets

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

  1. 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.
  2. Keep one tag of each pair on each link element, for example class="night".
  3. If you need styles for both cases, use two link elements, each with its own tag and title.
  4. 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-004 CSS documents must be encoded in UTF-8, detected …;
  • CSS-006 CSS selector specifies fixed position.
  • CSS-003 CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.
  • CSS-007 Font-face reference "…" refers to non-standard font type "…".
  • CSS-002 Empty or NULL reference found.
  • CSS-008 An error occurred while parsing the CSS: ….

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck CSS-005 mean?

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.

Is CSS-005 an error?

CSS-005 is reported as usage by default. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.