# HTM_056: viewport missing a dimension, how to fix it

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

EPUBCheck HTM_056 is an error message: “Viewport metadata has no "…" dimension (both "width" and "height" properties are required).” A fixed-layout viewport declares only one dimension, and both width and height are required. EPUBCheck names the dimension that is missing.

- Official message (EPUBCheck 5.4.0): Viewport metadata has no "%1$s" dimension (both "width" and "height" properties are required)
- Default severity: Error

## Typical causes

- A viewport with width but no height, or the reverse.
- A viewport copied from a web page, such as width=device-width, initial-scale=1, which has no height.

## 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. Declare both in the first viewport meta element of the head, for example content="width=1200, height=1600".
3. Use positive numbers in pixels, or device-width and device-height if the page should fill the screen.
4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

## When it's not this

If both are present but one value is not a number, that is HTM_057; a parse error is HTM-047.

## Sources

- EPUB 3.3, §8.2.2.6 Content document dimensions: https://www.w3.org/TR/epub-33/#sec-fxl-content-dimensions (read 2026-11-04)

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