Every HTML document follows the same skeleton. Knowing each part means you can start any page from scratch and understand any page you read.
The skeleton
<!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></head><body><h1>Hello, world!</h1><p>This is my first web page.</p></body></html>
What each part does
<!DOCTYPE html>— declares this is HTML5.<html>— the root element (setlangfor accessibility/SEO).<head>— metadata: title, charset, viewport, links (not visible on the page).<body>— the visible content of the page.
Key takeaways
- 01Every page: <!DOCTYPE html>, <html>, <head>, <body>.
- 02<!DOCTYPE html> declares HTML5; set lang on <html>.
- 03The <head> holds metadata (title, charset, viewport); the <body> holds visible content.
- 04The viewport meta tag is essential for correct mobile rendering.
