Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the meta viewport property of HTML

Shulou Source: shulou.com Published: 2022-06-01 11:14:30 10月03日 Update

This article mainly introduces how to use the meta viewport attribute of HTML. It is very detailed and has a certain reference value. Friends who are interested must finish it!

What is Viewport?

Mobile browsers place pages in a virtual "viewport" that is usually wider than the screen, so that instead of squeezing each page into a small window (which destroys the layout of pages that are not optimized for mobile browsers), users can pan and zoom to see different parts of the page. Mobile Safari browsers have recently introduced viewport as a metatag, allowing web developers to control the size and scaling of viewport, which is also basically supported by other mobile browsers.

Viewport Foundation

A commonly used viewportmeta tag for a page optimized for mobile pages is roughly as follows:

Tags: Browser device browsing resolution page problem width mobile phone user web page influence ratio different time physical or attributes same three content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi OPPO Reno MariaDB Redmi