HTML

Beginner · Roadmap · 57 lessons · 9 groups

What HTML is and how a browser turns it into a page — the document, text and links, semantic structure, images and media, tables, forms and validation, the head and how scripts load, accessibility, the interactive elements the platform ships (dialog, popover, details, templates), and the security, internationalization and tooling a production page needs. Styling is taught in css and scripting in javascript. 57 lessons.

0%

Not started

Nothing saved yet. Progress is kept in this browser until you sign in.

Start the path

HTML foundations · 7

Semantic structure · 5

Images and media · 8

Tables · 3

Forms · 10

The head and resource loading · 5

Accessibility · 6

Interactive elements · 7

Production HTML · 6

01What HTML Is and How Browsers Read ItHTML is text plus markup that a browser parses into a tree. See what the parser does with sloppy input and why HTML never throws an error.Beginner · 8 min02Anatomy of an HTML DocumentThe skeleton every page needs: doctype, html with lang, head, body, charset and title. See what the parser does when a tag lands in the wrong place.Beginner · 9 min03Elements, Attributes and NestingHow tags form elements, how attributes configure them, which elements are void, and what the parser does with boolean attributes, duplicates and bad nesting.Beginner · 14 min04Headings, Paragraphs and Text SemanticsUse h1 to h6 for structure, p for prose, and strong, em, b and i for meaning. See what the browser and the accessibility tree make of each.Beginner · 10 min05Lists and Description ListsWhen to use ul, ol and dl, how list markup shows up in the accessibility tree, and the nesting mistakes the parser does not repair for you.Beginner · 11 min06Links and URLsHow the a element and href work, how relative and absolute URLs resolve, how fragments scroll, and what target=_blank does to the opener.Beginner · 31 min07Entities, Whitespace and CommentsWrite reserved characters with entities, understand how browsers collapse whitespace, and use comments, with the parsing quirks found in a real browser.Beginner · 14 min01Landmarks and Page Layout Elementsheader, nav, main, aside, footer and search map to landmark roles. See when each one earns its role, and why scope and labels change the result.Beginner · 12 min02Article, Section and the OutlineWhen to use article, section and aside, why the HTML5 outline algorithm never worked, and how heading levels alone define the real document outline.Beginner · 8 min03Generic Containers: div and spandiv and span have no meaning of their own. Learn when they are the right wrapper, what they lack compared with native elements, and what the parser allows.Beginner · 12 min04Figure, Blockquote and CitationsUse figure and figcaption to caption self-contained content, blockquote and q for quotations, and cite for titles, with what each shows to assistive technology.Beginner · 8 min05Inline Semantics: time, mark, abbr and codeThe small elements that label words inside text: time, mark, abbr, code, kbd, del, ins and more. What each means, how browsers style it and what tools see.Beginner · 4 min01Images and Alt TextHow the img element works, what alt text is for, when alt should be empty, and what a browser does with a missing or broken image.Beginner · 13 min02Responsive Images: srcset and sizesHow srcset and sizes let the browser pick an image file by width and pixel density, with the selection results from a real browser at several viewports.Intermediate · 10 min03The picture Element and Art DirectionUse picture and source to change the crop of an image by viewport or to offer modern formats with a fallback, and see how first-match selection behaves.Intermediate · 12 min04Lazy Loading and Image DecodingUse loading=lazy to defer offscreen images and iframes, keep it off the main hero image, and know what decoding=async and img.decode() do. Tested in Chromium.Intermediate · 16 min05Audio and Video ElementsHow video and audio embed media without plugins: controls, source fallbacks by type, poster, preload and the autoplay rules, with what a real browser did.Beginner · 8 min06Captions, Subtitles and Text TracksHow the track element and WebVTT add captions and subtitles to video, when a track is fetched, and what happens with cross-origin files and missing attributes.Intermediate · 7 min07Iframes and Embedded ContentEmbed another page with iframe: title, loading, allow and sandbox, what a sandbox really blocks, and what happens when the other site forbids framing.Intermediate · 8 min08Inline SVG and CanvasCompare inline SVG, svg in an img, and canvas: what CSS and scripts can reach, how each appears to assistive technology, and when to pick which.Intermediate · 10 min01Table Structure and When to Use TablesWhat a table is for, the elements that build one (table, tr, th, td, thead, tbody, tfoot, caption), and why tables are for data, not page layout.Beginner · 6 min02Accessible Tables, Headers and CaptionsHow th, scope, caption and headers let a screen reader announce which row and column a cell belongs to, and how to check a table's accessible structure.Beginner · 4 min03Complex Tables, Spans and Column GroupsHow colspan and rowspan merge cells, what colgroup and col are for, and why a table with merged cells needs extra care for people using assistive software.Intermediate · 8 min01Forms, Labels and SubmissionHow a form turns controls into a request: action, method and name, which controls get submitted, and why every control needs a label.Beginner · 4 min02Input TypesWhat the type attribute of input changes: keyboards, validation and value formats for email, number, date, range and color, and when plain text is better.Beginner · 6 min03Textarea, Select and DatalistHow textarea, select and datalist collect multi-line text, a choice from a fixed list, and free text with suggestions, and what each one submits and validates.Beginner · 10 min04Fieldset, Legend and GroupingHow fieldset and legend group related controls, why a group of radio buttons needs a group name, and how a disabled fieldset switches off everything inside it.Beginner · 3 min05Buttons and Submit BehaviorHow button types submit, reset or do nothing, why a button inside a form submits by default, and how formaction, form and formnovalidate change a button's job.Beginner · 15 min06Built-in Form ValidationThe validation attributes (required, pattern, min, max, minlength), which controls skip validation, and when :invalid and :user-invalid apply.Beginner · 23 min07The Constraint Validation APIHow checkValidity, reportValidity, setCustomValidity and the validity object let a script reuse the browser's own validation to show custom messages and rules.Intermediate · 37 min08Autocomplete and Input ModesHow autocomplete lets browsers and password managers fill fields, how inputmode picks the on-screen keyboard, and why type=number is wrong for codes.Intermediate · 14 min09File Inputs and UploadsHow input type=file picks files, why a form needs enctype multipart/form-data to send them, what accept does not enforce, and how to read files in JavaScript.Intermediate · 13 min10Progress, Meter and OutputWhat progress, meter and output are for: a task's completion, a measurement within a range, and a calculated result, and how each differs from a styled div.Beginner · 7 min01Meta Tags and the ViewportWhat meta charset, viewport, description and robots do, what happens without charset, and why a page without the viewport tag looks zoomed out on phones.Beginner · 4 min02Link Elements, Stylesheets and IconsHow link rel connects a page to stylesheets, icons, a manifest and canonical URLs, why a stylesheet blocks rendering, and how to set up favicons.Beginner · 18 min03Script Loading, Async, Defer and ModulesHow a plain script blocks the parser, what async, defer and type=module change about download and execution order, and which to choose for each kind of script.Intermediate · 10 min04Resource Hints, Preload, Prefetch and PreconnectHow preload, prefetch, preconnect and fetchpriority tell the browser what to load early, what each one costs when misused, and what a test showed they do.Intermediate · 7 min05Social Metadata and Structured DataHow Open Graph and Twitter card tags shape link previews, how JSON-LD describes a page to search engines, and the escaping bug that breaks a block.Intermediate · 10 min01The Accessibility Tree and Native SemanticsHow the browser turns your markup into the accessibility tree that screen readers read, and why native elements give you roles, names and keyboard support.Beginner · 33 min02Keyboard, Focus and tabindexHow keyboard focus works in HTML: what takes focus by default, what tabindex 0, -1 and positive values do, and why native controls beat custom ones.Beginner · 5 min03ARIA Roles, States and PropertiesWhat ARIA adds to the accessibility tree, the difference between roles, states and properties, and the rules that keep it from making a page worse.Intermediate · 19 min04Accessible Names and DescriptionsHow the browser works out what a control is called: label, aria-labelledby, aria-label, content, title, and where descriptions from aria-describedby fit.Intermediate · 37 min05Hiding Content: hidden, inert and Visually HiddenWhich ways of hiding content remove it from the screen, the accessibility tree and the tab order: hidden, inert, aria-hidden, opacity and visually-hidden text.Intermediate · 12 min06Testing HTML AccessibilityWhat automated checkers like axe catch and miss, how to test by keyboard and screen reader, and how to read the browser's accessibility tree.Intermediate · 30 min01details and summaryHow the native disclosure widget works: the open attribute, exclusive accordions with name, the toggle event, keyboard behaviour, and find-in-page.Beginner · 6 min02The dialog ElementHow dialog gives you modals for free: showModal vs show, focus handling, Escape, the backdrop, returnValue, and what it still leaves to you.Intermediate · 31 min03The popover AttributeHow popover and popovertarget give you menus and tooltips without JavaScript: auto vs manual, light dismiss, nesting, events, and when to use dialog instead.Intermediate · 20 min04Data Attributes and Custom DataHow data-* attributes store custom values on elements, how dataset maps names and values, and how CSS can read them, plus what not to put in them.Beginner · 10 min05template and slotHow the template element holds inert markup you clone on demand, and how slot lets a component place the content you give it, with fallbacks and slotchange.Intermediate · 10 min06Custom Elements in HTMLHow custom element tags behave in markup: naming rules, the upgrade when you define them, lifecycle order, and keeping content useful if scripts fail.Intermediate · 9 min07contenteditable and Drag and DropHow contenteditable makes any element an editor, what plaintext-only changes, and why native drag and drop needs dragover cancelled and a keyboard fallback.Intermediate · 16 min01HTML Security: sandbox, noopener and EscapingEscape untrusted text before it becomes HTML, sandbox iframes you do not control, and know what target=_blank does to window.opener and the Referer header.Intermediate · 11 min02Language, Direction and InternationalizationWhat lang and dir tell the browser and assistive technology, how :lang() and text-transform react, and when dir=auto and bdi keep mixed-direction text correct.Intermediate · 17 min03HTML Validation and DebuggingWhy browsers never reject bad HTML, how the parser repairs it silently, and how the Nu validator and DevTools show what you wrote versus what you got.Beginner · 13 min04HTML Performance and Rendering CostHow the markup you ship affects load and rendering: blocking scripts, lazy images, reserved image space, DOM size, content-visibility, and LCP's four phases.Intermediate · 29 min05HTML Email and Legacy ConstraintsWhy HTML email still uses nested tables and inline styles, what role=presentation does for them, and how to build for clients you cannot control.Intermediate · 35 min06Writing Maintainable HTMLHabits that keep markup easy to change: native elements first, structure from content, few wrappers, unique ids, validation in CI, and a checklist for review.Intermediate · 39 min

HTML foundations

7 lessons

  1. 01 / 07What HTML Is and How Browsers Read ItHTML is text plus markup that a browser parses into a tree. See what the parser does with sloppy input and why HTML never throws an error.8 min
  2. 02 / 07Anatomy of an HTML DocumentThe skeleton every page needs: doctype, html with lang, head, body, charset and title. See what the parser does when a tag lands in the wrong place.9 min
  3. 03 / 07Elements, Attributes and NestingHow tags form elements, how attributes configure them, which elements are void, and what the parser does with boolean attributes, duplicates and bad nesting.14 min
  4. 04 / 07Headings, Paragraphs and Text SemanticsUse h1 to h6 for structure, p for prose, and strong, em, b and i for meaning. See what the browser and the accessibility tree make of each.10 min
  5. 05 / 07Lists and Description ListsWhen to use ul, ol and dl, how list markup shows up in the accessibility tree, and the nesting mistakes the parser does not repair for you.11 min
  6. 06 / 07Links and URLsHow the a element and href work, how relative and absolute URLs resolve, how fragments scroll, and what target=_blank does to the opener.31 min
  7. 07 / 07Entities, Whitespace and CommentsWrite reserved characters with entities, understand how browsers collapse whitespace, and use comments, with the parsing quirks found in a real browser.14 min

Semantic structure

5 lessons

  1. 01 / 05Landmarks and Page Layout Elementsheader, nav, main, aside, footer and search map to landmark roles. See when each one earns its role, and why scope and labels change the result.12 min
  2. 02 / 05Article, Section and the OutlineWhen to use article, section and aside, why the HTML5 outline algorithm never worked, and how heading levels alone define the real document outline.8 min
  3. 03 / 05Generic Containers: div and spandiv and span have no meaning of their own. Learn when they are the right wrapper, what they lack compared with native elements, and what the parser allows.12 min
  4. 04 / 05Figure, Blockquote and CitationsUse figure and figcaption to caption self-contained content, blockquote and q for quotations, and cite for titles, with what each shows to assistive technology.8 min
  5. 05 / 05Inline Semantics: time, mark, abbr and codeThe small elements that label words inside text: time, mark, abbr, code, kbd, del, ins and more. What each means, how browsers style it and what tools see.4 min

Images and media

8 lessons

  1. 01 / 08Images and Alt TextHow the img element works, what alt text is for, when alt should be empty, and what a browser does with a missing or broken image.13 min
  2. 02 / 08Responsive Images: srcset and sizesHow srcset and sizes let the browser pick an image file by width and pixel density, with the selection results from a real browser at several viewports.10 min
  3. 03 / 08The picture Element and Art DirectionUse picture and source to change the crop of an image by viewport or to offer modern formats with a fallback, and see how first-match selection behaves.12 min
  4. 04 / 08Lazy Loading and Image DecodingUse loading=lazy to defer offscreen images and iframes, keep it off the main hero image, and know what decoding=async and img.decode() do. Tested in Chromium.16 min
  5. 05 / 08Audio and Video ElementsHow video and audio embed media without plugins: controls, source fallbacks by type, poster, preload and the autoplay rules, with what a real browser did.8 min
  6. 06 / 08Captions, Subtitles and Text TracksHow the track element and WebVTT add captions and subtitles to video, when a track is fetched, and what happens with cross-origin files and missing attributes.7 min
  7. 07 / 08Iframes and Embedded ContentEmbed another page with iframe: title, loading, allow and sandbox, what a sandbox really blocks, and what happens when the other site forbids framing.8 min
  8. 08 / 08Inline SVG and CanvasCompare inline SVG, svg in an img, and canvas: what CSS and scripts can reach, how each appears to assistive technology, and when to pick which.10 min

Tables

3 lessons

  1. 01 / 03Table Structure and When to Use TablesWhat a table is for, the elements that build one (table, tr, th, td, thead, tbody, tfoot, caption), and why tables are for data, not page layout.6 min
  2. 02 / 03Accessible Tables, Headers and CaptionsHow th, scope, caption and headers let a screen reader announce which row and column a cell belongs to, and how to check a table's accessible structure.4 min
  3. 03 / 03Complex Tables, Spans and Column GroupsHow colspan and rowspan merge cells, what colgroup and col are for, and why a table with merged cells needs extra care for people using assistive software.8 min

Forms

10 lessons

  1. 01 / 10Forms, Labels and SubmissionHow a form turns controls into a request: action, method and name, which controls get submitted, and why every control needs a label.4 min
  2. 02 / 10Input TypesWhat the type attribute of input changes: keyboards, validation and value formats for email, number, date, range and color, and when plain text is better.6 min
  3. 03 / 10Textarea, Select and DatalistHow textarea, select and datalist collect multi-line text, a choice from a fixed list, and free text with suggestions, and what each one submits and validates.10 min
  4. 04 / 10Fieldset, Legend and GroupingHow fieldset and legend group related controls, why a group of radio buttons needs a group name, and how a disabled fieldset switches off everything inside it.3 min
  5. 05 / 10Buttons and Submit BehaviorHow button types submit, reset or do nothing, why a button inside a form submits by default, and how formaction, form and formnovalidate change a button's job.15 min
  6. 06 / 10Built-in Form ValidationThe validation attributes (required, pattern, min, max, minlength), which controls skip validation, and when :invalid and :user-invalid apply.23 min
  7. 07 / 10The Constraint Validation APIHow checkValidity, reportValidity, setCustomValidity and the validity object let a script reuse the browser's own validation to show custom messages and rules.37 min
  8. 08 / 10Autocomplete and Input ModesHow autocomplete lets browsers and password managers fill fields, how inputmode picks the on-screen keyboard, and why type=number is wrong for codes.14 min
  9. 09 / 10File Inputs and UploadsHow input type=file picks files, why a form needs enctype multipart/form-data to send them, what accept does not enforce, and how to read files in JavaScript.13 min
  10. 10 / 10Progress, Meter and OutputWhat progress, meter and output are for: a task's completion, a measurement within a range, and a calculated result, and how each differs from a styled div.7 min

The head and resource loading

5 lessons

  1. 01 / 05Meta Tags and the ViewportWhat meta charset, viewport, description and robots do, what happens without charset, and why a page without the viewport tag looks zoomed out on phones.4 min
  2. 02 / 05Link Elements, Stylesheets and IconsHow link rel connects a page to stylesheets, icons, a manifest and canonical URLs, why a stylesheet blocks rendering, and how to set up favicons.18 min
  3. 03 / 05Script Loading, Async, Defer and ModulesHow a plain script blocks the parser, what async, defer and type=module change about download and execution order, and which to choose for each kind of script.10 min
  4. 04 / 05Resource Hints, Preload, Prefetch and PreconnectHow preload, prefetch, preconnect and fetchpriority tell the browser what to load early, what each one costs when misused, and what a test showed they do.7 min
  5. 05 / 05Social Metadata and Structured DataHow Open Graph and Twitter card tags shape link previews, how JSON-LD describes a page to search engines, and the escaping bug that breaks a block.10 min

Accessibility

6 lessons

  1. 01 / 06The Accessibility Tree and Native SemanticsHow the browser turns your markup into the accessibility tree that screen readers read, and why native elements give you roles, names and keyboard support.33 min
  2. 02 / 06Keyboard, Focus and tabindexHow keyboard focus works in HTML: what takes focus by default, what tabindex 0, -1 and positive values do, and why native controls beat custom ones.5 min
  3. 03 / 06ARIA Roles, States and PropertiesWhat ARIA adds to the accessibility tree, the difference between roles, states and properties, and the rules that keep it from making a page worse.19 min
  4. 04 / 06Accessible Names and DescriptionsHow the browser works out what a control is called: label, aria-labelledby, aria-label, content, title, and where descriptions from aria-describedby fit.37 min
  5. 05 / 06Hiding Content: hidden, inert and Visually HiddenWhich ways of hiding content remove it from the screen, the accessibility tree and the tab order: hidden, inert, aria-hidden, opacity and visually-hidden text.12 min
  6. 06 / 06Testing HTML AccessibilityWhat automated checkers like axe catch and miss, how to test by keyboard and screen reader, and how to read the browser's accessibility tree.30 min

Interactive elements

7 lessons

  1. 01 / 07details and summaryHow the native disclosure widget works: the open attribute, exclusive accordions with name, the toggle event, keyboard behaviour, and find-in-page.6 min
  2. 02 / 07The dialog ElementHow dialog gives you modals for free: showModal vs show, focus handling, Escape, the backdrop, returnValue, and what it still leaves to you.31 min
  3. 03 / 07The popover AttributeHow popover and popovertarget give you menus and tooltips without JavaScript: auto vs manual, light dismiss, nesting, events, and when to use dialog instead.20 min
  4. 04 / 07Data Attributes and Custom DataHow data-* attributes store custom values on elements, how dataset maps names and values, and how CSS can read them, plus what not to put in them.10 min
  5. 05 / 07template and slotHow the template element holds inert markup you clone on demand, and how slot lets a component place the content you give it, with fallbacks and slotchange.10 min
  6. 06 / 07Custom Elements in HTMLHow custom element tags behave in markup: naming rules, the upgrade when you define them, lifecycle order, and keeping content useful if scripts fail.9 min
  7. 07 / 07contenteditable and Drag and DropHow contenteditable makes any element an editor, what plaintext-only changes, and why native drag and drop needs dragover cancelled and a keyboard fallback.16 min

Production HTML

6 lessons

  1. 01 / 06HTML Security: sandbox, noopener and EscapingEscape untrusted text before it becomes HTML, sandbox iframes you do not control, and know what target=_blank does to window.opener and the Referer header.11 min
  2. 02 / 06Language, Direction and InternationalizationWhat lang and dir tell the browser and assistive technology, how :lang() and text-transform react, and when dir=auto and bdi keep mixed-direction text correct.17 min
  3. 03 / 06HTML Validation and DebuggingWhy browsers never reject bad HTML, how the parser repairs it silently, and how the Nu validator and DevTools show what you wrote versus what you got.13 min
  4. 04 / 06HTML Performance and Rendering CostHow the markup you ship affects load and rendering: blocking scripts, lazy images, reserved image space, DOM size, content-visibility, and LCP's four phases.29 min
  5. 05 / 06HTML Email and Legacy ConstraintsWhy HTML email still uses nested tables and inline styles, what role=presentation does for them, and how to build for clients you cannot control.35 min
  6. 06 / 06Writing Maintainable HTMLHabits that keep markup easy to change: native elements first, structure from content, few wrappers, unique ids, validation in CI, and a checklist for review.39 min
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark