# EPUBCheck HTM-047: viewport syntax error, how to fix it

Source: https://epubcc.com/epubcheck/htm-047/ (updated 2026-11-04)

EPUBCheck HTM-047 is an error message: “Viewport metadata "…" has a syntax error.” The viewport meta element of a fixed-layout document has a syntax error. The content attribute must be a list of name=value properties separated by commas, semicolons or spaces, and EPUBCheck quotes the value it could not parse.

- Official message (EPUBCheck 5.4.0): Viewport metadata "%1$s" has a syntax error
- Default severity: Error

## Typical causes

- Wrong separators or a missing equals sign in the content attribute.
- Misspelled keys or stray characters, for example a trailing comma or quotes inside the value.

## 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. Write it as content="width=1200, height=1600": width and height, each with a value, separated by a comma.
3. Keep other viewport properties out of fixed-layout pages unless you need them; reading apps ignore them.
4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

## When it's not this

If the syntax is fine but width or height is missing, that is HTM_056; a bad value is HTM_057.

## Sources

- EPUB 3.3, §F.2 The viewport meta tag, syntax: https://www.w3.org/TR/epub-33/#app-viewport-meta-syntax (read 2026-11-04)

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