Meta viewport for mobile devices
Mobile devices render pages in a virtual viewport, which is usually wider than the screen, and shrink the content to fit. This viewport won't work when we want to use [[Media queries]]. If the viewport is
980px
and we have media queries that target 480px
, they'll never fire.[[Apple]] introduced the
viewport
meta
tag in [[Safari]] to let developers control the viewport's size and scale. This is not part of any web standard, but it's supported by most other mobile browsers.<meta name="viewport" content="width=device-width, initial-scale=1">