HTML Fundamentals

Structure your webpage with clean, semantic markup.

Basics

HTML (HyperText Markup Language) provides the semantic structure of web pages. Use proper tags to improve accessibility and SEO.

Document 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>
  <header>...</header>
  <main>...</main>
  <footer>...</footer>
</body>
</html>

Semantic Elements

Tip: One <h1> per page is a good practice; subsections can use <h2> and below.

Forms

Forms collect user input. Always associate labels with inputs for accessibility.

<form action="/subscribe" method="post">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <button type="submit">Subscribe</button>
</form>

Media

<img src="hero.png" alt="Hero banner">
<video controls>
  <source src="intro.mp4" type="video/mp4">
  Sorry, your browser doesn't support embedded videos.
</video>