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
- 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.
- Keep one width and one height in the content attribute, with the size the page was designed for.
- Check the other fixed-layout pages, which were often made from the same template.
- 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_058HTML documents must be encoded in UTF-8, but UTF-16 was detected.HTM_060bEPUB reading systems must ignore viewport meta elements in reflowable documents; viewport declaration "…" will be ignored.HTM_057Viewport "…" 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_056Viewport metadata has no "…" dimension (both "width" and "height" properties are required)HTM_062SVG "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.