HTML/CSSBeginner#html#meta#responsive

What does the viewport meta tag do and why is it needed?

It instructs mobile browsers to set the layout viewport width to the device's width and an initial zoom level of 1, instead of rendering a shrunk desktop-width page. Without it, responsive CSS media queries won't work correctly on mobile.

Example
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Related Questions

1
HTML/CSSIntermediate#html#performance

What is the difference between <script>, <script async>, and <script defer>?

Open
2
HTML/CSSBeginner#html#forms

What HTML5 form input types do you know?

Open
3
HTML/CSSIntermediate#html#forms

How do you validate a form using native HTML attributes?

Open