Performance: First HTML page
MEDIUM IMPACT
This affects the initial page load speed and how quickly the browser can show content to the user.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Page</title> <style> body { background-color: #fff; color: #000; font-family: sans-serif; } </style> </head> <body> <h1>Welcome</h1> <p>This is my first page.</p> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>My Page</title> <script src="large-library.js"></script> <style> body { background: url('large-image.jpg'); } </style> </head> <body> <h1>Welcome</h1> <p>This is my first page.</p> </body> </html>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Minimal HTML with inline CSS | Low (few nodes) | 1 (initial layout) | Low (simple styles) | [OK] Good |
| HTML with blocking scripts and large images | Medium (more nodes) | Multiple (due to blocking) | High (heavy styles and images) | [X] Bad |