HTML

html/doctype

Every HTML document starts with <!doctype html> so the browser renders it in standards mode.

umiarkowanastatycznefe-html

Dlaczego

Without a doctype, browsers switch to quirks mode, which emulates old rendering bugs: the box model, table sizing and line heights differ, so the layout breaks in ways CSS alone cannot explain.

Poprawka

Make <!doctype html> the very first line of every HTML document (case does not matter). Partial templates and framework components do not need it.

Przykłady

<!-- bad -->
<html lang="en">
<!-- good -->
<!doctype html>
<html lang="en">

Źródła

Fakty

Identyfikator
html/doctype
Waga
umiarkowana
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html
Ten sam problem w
Lighthouse doctype
Uczy jej skill
fe-html HTML documents and semantics
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain html/doctype