Performance: What is HTML
MEDIUM IMPACT
HTML structure affects how quickly the browser can start rendering the page and how efficiently it processes content.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Page</title> </head> <body> <main>Content</main> </body> </html>
<html><head><title>Page</title></head><body><div><div><div><div>Content</div></div></div></div></body></html>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deeply nested divs | High (many nodes) | Multiple reflows | High | [X] Bad |
| Simple semantic HTML | Low (few nodes) | Single reflow | Low | [OK] Good |