Skip to content
EPUBCheck · XHTML content documents

HTM_057

Updated:

EPUBCheck HTM_057 is an error message: “Viewport "…" value must be a positive number or the keyword "device-…".” A viewport width or height is not a positive number or the device-width/device-height keyword.

The official message

Viewport "%1$s" value must be a positive number or the keyword "device-%1$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

  • Values with units (px, %), zero or negative numbers, or typos.

How to fix it

  • Use a plain positive number, for example width=1200.

Terms used here

Other HTM messages

  • HTM_055 The "…" element should not be used (discouraged construct)
  • HTM_060a EPUB reading systems must ignore secondary viewport meta elements in fixed-layout documents; viewport declaration "…" will be ignored.
  • HTM_060b EPUB reading systems must ignore viewport meta elements in reflowable documents; viewport declaration "…" will be ignored.
  • 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_062 SVG "xlink:href" attribute is deprecated; an "href" attribute should be used instead.
  • HTM_063 SVG "xlink:href" attribute value ("…") should be equal to the "href" attribute value ("…").

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

FAQ

What does EPUBCheck HTM_057 mean?

EPUBCheck HTM_057 is an error message: “Viewport "…" value must be a positive number or the keyword "device-…".” A viewport width or height is not a positive number or the device-width/device-height keyword.

Is HTM_057 an error?

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