Performance: Header, footer, main
Using semantic elements like header, footer, and main helps browsers render content faster by improving document structure and accessibility.
<header>...</header> <main>...</main> <footer>...</footer>
<div id="header">...</div> <div id="content">...</div> <div id="footer">...</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Generic divs for layout | Minimal | Minimal | Minimal | [!] OK |
| Semantic header, main, footer | Minimal | Minimal | Minimal | [OK] Good |
<header>Site Title</header> <main>Welcome to our website</main> <footer>Contact info</footer>
<header>Welcome</header> <main>Content here</main> <footer>Footer info<footer>
Pass the test and this pattern moves unknown