EPUBCheck CSS-015: alternate CSS without title
Updated:
EPUBCheck CSS-015 is an error message: “Alternative style sheets must have a title.” An alternative style sheet has no title attribute. A link with rel="alternate stylesheet" needs a title, because the title is what a reading app shows when offering the alternative style.
The official message
Alternative style sheets must have a title.
- 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
Typical causes
- A link element for an alternate style written without title.
- A night or vertical-writing style added by a tool that left the title out.
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.
- Add a title attribute that names the style, for example
<link rel="alternate stylesheet" title="Night" href="night.css" type="text/css"/>. - If the stylesheet should always apply, change rel to plain stylesheet instead.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the alternate style sheets carry conflicting style tags, see CSS-005.
Terms used here
Other CSS messages
CSS-019CSS font-face declaration has no attributes.CSS-008An error occurred while parsing the CSS: ….CSS-007Font-face reference "…" refers to non-standard font type "…".CSS-006CSS selector specifies fixed position.CSS-005Conflicting alternate style tags found: ….CSS-004CSS documents must be encoded in UTF-8, detected …;
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.