WEB-4Recommended
Fit the page to the phone
Add <meta name="viewport" content="width=device-width, initial-scale=1"> to every page, and never turn off zooming.
How to do it
Put the viewport tag in the shared head. Never add maximum-scale or user-scalable=no. Keep zoom working as Let text grow without breaking the page says.
Examples
HTML example
<!-- Good -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bad: blocks zoom for people who need it -->
<meta name="viewport" content="width=device-width, maximum-scale=1, user-scalable=no">
How to check
Lighthouse viewport-insight passes (named viewport before Lighthouse 13). A build gate finds no maximum-scale or user-scalable in any page.
Measured
On a reference site, removing it dropped Lighthouse Best Practices from 100 to 93 on phones, and from 100 to 96 on desktop. It also raised layout shift on phones from 0 to 0.034.
Sources
Related rules
- AXS-7 Let text grow without breaking the page in Accessibility
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/html-basics/meta-viewport">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.