docs.rodeo

MDN Web Docs mirror

CSS viewport

The CSS viewport module enables specifying the size, zoom factor, and orientation of the user-agent’s initial containing block, or viewport.

Content designed for large viewports may exhibit a variety of bugs when viewed in smaller viewports, including unintended wrapping, clipped content, and incorrectly sized {{glossary("scroll container", "scroll containers")}} . HTML provides a viewport meta tag, <meta name="viewport">, to provide hints about the initial size of the viewport. If the site isn’t designed to work well on small viewports and this tag is omitted, some mobile browsers render the site using a fixed initial containing block width, typically 980px. The content is then scaled down, making the CSS pixel size smaller than an actual pixel. The resulting page fits into the available screen space but is illegible, requiring the user to zoom and pan to view the content.

The {{glossary("viewport")}}  initial containing block for continuous media has the dimensions of the viewport. Since the viewport is generally no larger than the display, devices with smaller displays, such as phones or tablets, typically present a smaller viewport than larger devices like desktops or laptops.

Reference

Properties

Interfaces

Glossary terms and definitions

Guides

Specifications

{{Specifications}} 

See also

In this article

View on MDN