HTML
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.
What 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.Anatomy 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.Elements, 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.Headings, 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.Lists 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.Links 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.Entities, Whitespace and CommentsWrite reserved characters with entities, understand how browsers collapse whitespace, and use comments, with the parsing quirks found in a real browser.Landmarks 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.Article, 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.Generic 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.Figure, 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.Inline 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.Images 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.Responsive 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.The 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.Lazy 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.Audio 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.Captions, 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.Iframes 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.Inline 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.Table 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.Accessible 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.Complex 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.Forms, 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.Input 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.Textarea, 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.Fieldset, 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.Buttons 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.Built-in Form ValidationThe validation attributes (required, pattern, min, max, minlength), which controls skip validation, and when :invalid and :user-invalid apply.The 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.Autocomplete 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.File 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.Progress, 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.Meta 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.Link 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.Script 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.Resource 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.Social 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.The 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.Keyboard, 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.ARIA 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.Accessible 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.Hiding 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.Testing 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.details and summaryHow the native disclosure widget works: the open attribute, exclusive accordions with name, the toggle event, keyboard behaviour, and find-in-page.The dialog ElementHow dialog gives you modals for free: showModal vs show, focus handling, Escape, the backdrop, returnValue, and what it still leaves to you.The 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.Data 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.template 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.Custom 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.contenteditable 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.HTML 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.Language, 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.HTML 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.HTML 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.HTML 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.Writing 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.
HTML foundations
- What 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.
- Anatomy 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.
- Elements, 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.
- Headings, 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.
- Lists 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.
- Links 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.
- Entities, Whitespace and CommentsWrite reserved characters with entities, understand how browsers collapse whitespace, and use comments, with the parsing quirks found in a real browser.
Semantic structure
- Landmarks 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.
- Article, 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.
- Generic 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.
- Figure, 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.
- Inline 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.
Images and media
- Images 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.
- Responsive 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.
- The 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.
- Lazy 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.
- Audio 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.
- Captions, 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.
- Iframes 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.
- Inline 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.
Tables
- Table 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.
- Accessible 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.
- Complex 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.
Forms
- Forms, 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.
- Input 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.
- Textarea, 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.
- Fieldset, 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.
- Buttons 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.
- Built-in Form ValidationThe validation attributes (required, pattern, min, max, minlength), which controls skip validation, and when :invalid and :user-invalid apply.
- The 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.
- Autocomplete 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.
- File 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.
- Progress, 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.
The head and resource loading
- Meta 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.
- Link 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.
- Script 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.
- Resource 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.
- Social 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.
Accessibility
- The 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.
- Keyboard, 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.
- ARIA 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.
- Accessible 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.
- Hiding 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.
- Testing 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.
Interactive elements
- details and summaryHow the native disclosure widget works: the open attribute, exclusive accordions with name, the toggle event, keyboard behaviour, and find-in-page.
- The dialog ElementHow dialog gives you modals for free: showModal vs show, focus handling, Escape, the backdrop, returnValue, and what it still leaves to you.
- The 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.
- Data 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.
- template 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.
- Custom 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.
- contenteditable 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.
Production HTML
- HTML 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.
- Language, 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.
- HTML 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.
- HTML 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.
- HTML 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.
- Writing 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.