Skip to content
EPUBCheck · XHTML content documents

EPUBCheck HTM_059: viewport property repeated

Updated:

EPUBCheck HTM_059 is an error message: “Viewport "…" property must not be defined more than once, but found values […].” A viewport defines the same property twice with different values. EPUB forbids more than one width or height definition in a viewport meta element, and EPUBCheck lists the values it found.

The official message

Viewport "%1$s" property must not be defined more than once, but found values [%2$s].

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

EPUBCheck prints this ID with an underscore instead of a hyphen; this page uses the ID exactly as EPUBCheck reports it.

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • Two width or two height values in one viewport declaration, often after editing the size by hand.
  • A template value left in place and a new value added after it.

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 width and one height in the content attribute, with the size the page was designed for.
  3. Check the other fixed-layout pages, which were often made from the same template.
  4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If there are two whole viewport meta elements rather than two values in one, see HTM_060b.

Terms used here

Other HTM messages

  • HTM_058 HTML documents must be encoded in UTF-8, but UTF-16 was detected.
  • HTM_060b EPUB reading systems must ignore viewport meta elements in reflowable documents; viewport declaration "…" will be ignored.
  • HTM_057 Viewport "…" value must be a positive number or the keyword "device-…"
  • HTM_061 "…" is not a valid custom data attribute (it must have at least one character after the hyphen, be XML-compatible, and not contain ASCII uppercase letters).
  • HTM_056 Viewport metadata has no "…" dimension (both "width" and "height" properties are required)
  • HTM_062 SVG "xlink:href" attribute is deprecated; an "href" attribute should be used instead.

Sources

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

FAQ

What does EPUBCheck HTM_059 mean?

EPUBCheck HTM_059 is an error message: “Viewport "…" property must not be defined more than once, but found values […].” A viewport defines the same property twice with different values. EPUB forbids more than one width or height definition in a viewport meta element, and EPUBCheck lists the values it found.

Is HTM_059 an error?

HTM_059 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.

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.