HTML (HyperText Markup Language)

HTML is the standard markup language for creating web pages. It provides the structure and content of web documents using a system of tags and elements.

Basic Structure

html
<!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>
  <h1>Welcome</h1>
  <p>This is a paragraph.</p>
</body>
</html>

Semantic HTML

Using meaningful tags improves accessibility and SEO:

html
<header>
  <nav><!-- navigation --></nav>
</header>

<main>
  <article>
    <h1>Article Title</h1>
    <p>Content...</p>
  </article>
</main>

<footer>
  <!-- footer content -->
</footer>

Common Elements

Text <h1> to <h6>, <p>, <span>, <strong>, <em>

Links & Media <a>, <img>, <video>, <audio>

Forms <form>, <input>, <button>, <select>, <textarea>

Layout <div>, <section>, <article>, <header>, <footer>, <nav>

Attributes

html
<a href="https://example.com" target="_blank" rel="noopener">
  Link Text
</a>

<img src="image.jpg" alt="Description" width="300" height="200">

Learn More