Skip to content
EPUBCheck · Stylesheets

EPUBCheck CSS-002: empty url() reference in CSS

Updated:

EPUBCheck CSS-002 is an error message: “Empty or NULL reference found.” The CSS has an empty reference, such as url() with nothing inside. An empty reference points nowhere, so reading apps cannot load anything from it, and EPUBCheck reports it as an error.

The official message

Empty or NULL reference found.

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 background or font URL removed without removing the declaration.
  • A stylesheet generated from a template whose image or font path was never filled in.

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. Delete the declaration with the empty url(), or fill in the path to a file that is in the EPUB.
  3. If you add a file, list it in the manifest with its media type.
  4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If url() names a file that is not in the EPUB, the message is RSC-007.

Terms used here

Other CSS messages

  • CSS-001 The "…" property must not be included in an EPUB Style Sheet.
  • CSS-003 CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.
  • CSS-004 CSS documents must be encoded in UTF-8, detected …;
  • CSS-005 Conflicting alternate style tags found: ….
  • CSS-006 CSS selector specifies fixed position.
  • CSS-007 Font-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.

FAQ

What does EPUBCheck CSS-002 mean?

EPUBCheck CSS-002 is an error message: “Empty or NULL reference found.” The CSS has an empty reference, such as url() with nothing inside. An empty reference points nowhere, so reading apps cannot load anything from it, and EPUBCheck reports it as an error.

Is CSS-002 an error?

CSS-002 is reported as error by default. 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.