Responsywność

responsive/viewport-meta

Every HTML document has <meta name="viewport" content="width=device-width, initial-scale=1">.

poważnastatycznefe-responsive

Dlaczego

Without it, mobile browsers lay the page out at a desktop width (usually 980 px) and shrink it, so text is tiny and media queries never match.

Poprawka

Put <meta name="viewport" content="width=device-width, initial-scale=1"> in the head of every document. Next.js and Nuxt add it for you; plain HTML, Astro layouts and SvelteKit's app.html need it written.

Przykłady

<!-- bad -->
<head><title>Shop</title></head>
<!-- good -->
<head><meta name="viewport" content="width=device-width, initial-scale=1"><title>Shop</title></head>

Źródła

Fakty

Identyfikator
responsive/viewport-meta
Waga
poważna
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html astro
Ten sam problem w
Lighthouse viewport-insight
Uczy jej skill
fe-responsive Responsive design
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain responsive/viewport-meta