CODY ← Back to Courses
</>

HTML — HyperText Markup Language

The skeleton of every webpage. Learn how to structure content using tags, elements and attributes — the foundation of all web development.

Beginner Friendly Web Foundation Markup Language

What is HTML?

HTML stands for HyperText Markup Language. It defines the structure and meaning of web content using elements (tags). Every website you visit is built on HTML.

📄 Markup Language

HTML uses tags to annotate text and define its role: heading, paragraph, link, image, etc.

🌐 Rendered by Browsers

Browsers read HTML and display it visually. They hide the tags and show only the content.

🧱 Foundation Layer

HTML is the base layer. CSS adds styling, JavaScript adds behaviour — but HTML is always first.

Document Structure

Every HTML file follows the same skeleton. Here is the minimal template that every page starts with:

boilerplate
<!-- Every HTML page starts with this -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Page</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
    <p>This is a paragraph.</p>
  </body>
</html>
1

<!DOCTYPE html>

Tells the browser this is an HTML5 document. Always the very first line.

2

<head>

Contains invisible metadata: character set, page title, links to stylesheets and scripts.

3

<body>

Everything visible on the page goes here — text, images, buttons, menus.

Essential Tags

These are the most commonly used HTML tags. Memorize these and you can build any basic page.

TagUseExample
<h1>–<h6>Headings, h1 = largest<h1>Title</h1>
<p>Paragraph of text<p>Hello</p>
<a>Hyperlink<a href="#">Click</a>
<img>Image<img src="cat.jpg">
<ul> / <ol>Unordered / ordered list<ul><li>Item</li></ul>
<div>Generic container block<div class="box">…</div>
<span>Inline container<span>word</span>
<br>Line break (self-closing)Line 1<br>Line 2
<strong>Bold / important text<strong>Bold</strong>
<em>Italic / emphasis<em>Italic</em>
<table>Data table<table><tr><td>…
<button>Clickable button<button>OK</button>

Attributes

Attributes provide extra information about elements. They are written inside the opening tag as name="value" pairs.

attributes example
<!-- href is an attribute of <a> -->
<a href="https://example.com" target="_blank">Open Link</a>

<!-- src and alt are attributes of <img> -->
<img src="photo.jpg" alt="A photo" width="300">

<!-- id and class are universal attributes -->
<div id="header" class="container dark">…</div>
💡 Tip: The id must be unique on the page. The class can be reused on many elements and is the main way CSS targets elements.

Forms & Inputs

Forms collect user input — login data, search queries, signup info. Every interactive website uses them.

login form
<form action="/login" method="post">

  <label for="user">Username:</label>
  <input type="text" id="user" name="username" placeholder="Enter name">

  <label for="pass">Password:</label>
  <input type="password" id="pass" name="password">

  <button type="submit">Login</button>

</form>

type="text"

Single-line text input.

type="password"

Hides typed characters.

type="email"

Validates email format automatically.

type="checkbox"

On/off toggle box.

type="radio"

Pick one from a group.

<textarea>

Multi-line text input.

Semantic HTML

Semantic tags describe the meaning of content, not just its appearance. They improve accessibility and SEO.

semantic layout
<header>
  <nav>…</nav>
</header>

<main>
  <article>
    <h2>Blog Post Title</h2>
    <section>…</section>
  </article>
  <aside>Related Links</aside>
</main>

<footer>© 2026</footer>
✅ Best Practice: Use <div> for styling/layout purposes only. Use semantic tags like <header>, <main>, <footer>, <article> when the content has a clear meaning.

🛠 First Project: Personal Card

Put it all together! Build your first HTML page — a personal profile card using everything you've learned.

project: profile-card.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Profile</title>
</head>
<body>
  <header>
    <h1>John Doe</h1>
    <p>Junior Web Developer</p>
  </header>

  <main>
    <img src="avatar.jpg" alt="Profile photo" width="120">
    <section>
      <h2>About Me</h2>
      <p>I love building websites and learning new tech.</p>
    </section>
    <section>
      <h2>Skills</h2>
      <ul>
        <li>HTML</li>
        <li>CSS</li>
        <li>JavaScript</li>
      </ul>
    </section>
  </main>

  <footer>
    <p>Contact: <a href="mailto:john@example.com">john@example.com</a></p>
  </footer>
</body>
</html>
🎯 Challenge: Add a <form> at the bottom that lets visitors send a message. Use inputs for name, email and a <textarea> for the message.