Core Web Standard

Modern HTML5 Fundamentals

The structural skeleton of every webpage on earth. Learn semantic markup, accessible forms, modern media embedding, and clean document architecture from scratch.

Author: Dhwani Akhilesh • Updated for 2026/2027 • 9 Modules with Live Hands-On Lab
Launch Hands-On HTML Lab
1

What is HTML? The Skeleton Analogy

Explain Like I'm 10: Building a Human Body

Every website is built using three primary technologies:

1. HTML (The Skeleton): Provides the raw bones, head, ribs, and structure. Without a skeleton, you just have a shapeless pile of nothing.
2. CSS (The Clothes, Skin & Makeup): Makes the skeleton look attractive with colors, fonts, margins, and hairstyles.
3. JavaScript (The Brain & Muscles): Gives the skeleton the ability to run, jump, blink, and react when someone taps on its shoulder.

HTML stands for HyperText Markup Language. You don't "program" in HTML; you "mark up" content so your browser understands what is a title, what is a paragraph, and what is a button.

2

Tags, Elements & Attributes

An HTML Element is made up of an opening tag, content, and a closing tag:

<p class="intro-text">Hello, Welcome to Free Qube!</p>
  • <p>: Opening tag (signals the start of a paragraph).
  • class="intro-text": An Attribute providing extra information or styling hooks.
  • Hello, Welcome to Free Qube!: The actual content users see.
  • </p>: Closing tag (ends with a forward slash /).
Self-Closing (Void) Tags

Some tags do not wrap around text and therefore do not require a closing tag. Examples include:

<img src="logo.png" alt="Company Logo"> <br> <!-- Line break --> <hr> <!-- Horizontal thematic divider --> <input type="text" placeholder="Enter your email">
3

Anatomy of an HTML5 Document

Every web page starts with the exact standard boilerplate structure:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Awesome Website</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Hello World!</h1> <p>This is my first web page on the internet.</p> </body> </html>
Element Purpose
<!DOCTYPE html> Tells the browser to render using modern HTML5 standard mode.
<head> Invisible metadata container (charset, viewport, SEO title, favicon, stylesheet links).
<body> Everything visible on the screen (headers, text, images, videos, tables).
4

Semantic HTML5: Clean Meaningful Structure

In old HTML, developers wrapped everything in generic <div> tags (known as "div soup"). Modern HTML5 introduced semantic tags that clearly explain their purpose to web browsers, search engines (Googlebot), and assistive screen readers:

<header> & <nav>

Contains website logos, main navigation bars, user search bars, and top-level menu links.

<main>

The central, unique content of the page. There should only be one <main> element per HTML document.

<article> & <section>

<article> represents independent, self-contained content (like a blog post or news item). <section> groups related thematic content.

<footer>

Appears at the bottom of the page or article with copyright info, privacy policy links, and contact details.

5

Forms, Inputs & Modern Validation

Forms are how users send data (logins, feedback, orders) to web servers. Modern HTML5 provides built-in client-side validation without writing custom JavaScript:

<form action="/submit" method="POST"> <label for="username">Full Name:</label> <input type="text" id="username" name="username" required minlength="3"> <label for="email">Email Address:</label> <input type="email" id="email" name="email" required> <button type="submit">Sign Up</button> </form>
Accessibility Tip: Always associate <label for="..."> with the matching <input id="..."> so that clicking the text label automatically focuses the input box.
6

Images, Responsive Media & Performance

Loading heavy unoptimized images slows down web pages and hurts Google PageSpeed Core Web Vitals. HTML5 provides modern attributes to ensure lightning-fast image loading:

<!-- Modern high-performance responsive image --> <img src="hero-desktop.jpg" alt="Students learning code in a bright classroom" width="800" height="450" loading="lazy" decoding="async">
  • alt="...": Mandatory for accessibility. If the image fails to load or a blind user uses a screen reader, this description is read aloud.
  • width and height: Prevents Cumulative Layout Shift (CLS) by reserving physical space before the image finishes downloading.
  • loading="lazy": Native browser lazy-loading. Images below the fold are only downloaded when the user scrolls near them!
7

Accessibility (A11y) & SEO Best Practices

SEO Hierarchy Rules
  • Exactly ONE <h1> per page: Represents the primary headline of the document.
  • Never skip heading levels: Always nest logically: h1 → h2 → h3 (never jump from h1 directly to h4).
  • Meaningful anchor text: Never write "Click Here". Write descriptive links like "Download our Salesforce Study Guide".
Accessibility (WCAG 2.2)
  • Interactive elements: Use native <button> for clicks and <a> for navigation. Never style a <div> as a button without keyboard listeners!
  • Color Contrast: Ensure text maintains at least a 4.5:1 contrast ratio against the background.
  • ARIA Labels: Use aria-label when buttons only contain visual icons (e.g., search magnifying glass or hamburger menu).
8

HTML5 Quick Tag Reference Cheatsheet

Category Tags Description
Document <html>, <head>, <body>, <title>, <meta> Overall webpage root and metadata instructions.
Structure <header>, <nav>, <main>, <section>, <article>, <footer> Modern semantic layout hierarchy.
Text <h1>-<h6>, <p>, <strong>, <em>, <blockquote> Headings, paragraphs, bold emphasis, and quotes.
Lists <ul> (unordered bullet), <ol> (numbered order), <li> (list item) Itemized lists and bulleted content.
Forms <form>, <input>, <textarea>, <select>, <button> Interactive data entry and user submissions.
Media <img>, <video>, <audio>, <canvas>, <svg> Graphics, responsive imagery, and streaming players.

Module 9: Interactive Hands-On HTML Lab & Live Browser Preview

The best way to master HTML is by building real pages with your own hands. Use the interactive split-screen playground below: select a starter exercise or write your own custom markup. Your live web page renders immediately on the right!

index.html (HTML + CSS Editor) Editable
Live Browser Output Preview Real-time Sandbox
Interactive Learning Challenges to Try:
  • Challenge 1: Change the background color, headline text, or button labels in the editor and watch the preview update instantly.
  • Challenge 2: In Exercise 3, try typing an invalid email into the form and click "Submit" to see native HTML5 validation popups in action.
  • Challenge 3: Press Tab inside the editor to cleanly indent your tags with 2 spaces!