The HTML Skeleton
Every HTML document starts with the same fundamental structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>What Each Part Does
| Tag | Purpose |
|---|---|
<!DOCTYPE html> | Tells the browser this is HTML5 |
<html lang="en"> | Root element, sets page language |
<head> | Metadata — title, charset, links to CSS |
<meta charset="UTF-8"> | Enables all Unicode characters (emojis, accents) |
<meta name="viewport"> | Makes page responsive on mobile |
<title> | Tab/bookmark title shown in the browser |
<body> | Everything visible on the page |
Always include the viewport meta tag — without it your page will look zoomed out on phones.