HTML5

HTML5 Tutorial & Reference

Semantic structure, accessible forms, media performance, and native dialogs.

Popular:

HTML5 Learning Path

Follow the HTML5 Curriculum

Read the guides in order from fundamentals to production patterns, or jump to your current skill level.

Showing 49 of 49 guides

HTML5 Beginner

HTML5 Document Structure: DOCTYPE, Head, and Body

How do I write a valid HTML5 document from scratch?

Document Structure 7 min
HTML5 Beginner

HTML Charset, Viewport, and SEO Meta Tags

Which meta tags belong in the head of every HTML page?

Document Structure 7 min
HTML5 Beginner

HTML Headings and a Logical Document Outline

How should h1 through h6 be used so the outline stays logical?

Semantic Structure 7 min
HTML5 Beginner

HTML Paragraphs, Line Breaks, and Readable Text

When should I use a paragraph instead of a br line break?

Semantic Structure 6 min
HTML5 Beginner

HTML5 Semantic Landmarks: header, nav, main, and footer

How do I structure header, nav, main, article, section, aside, and footer?

Semantic Structure 8 min
HTML5 Intermediate

ARIA Basics: Roles, Labels, and When Not to Use Them

When should I add ARIA, and when is native HTML enough?

Semantic Structure 9 min
HTML5 Beginner

HTML Links: href, Absolute and Relative URLs, and rel

How do I write accessible links with safe href and rel values?

Semantic Structure 7 min
HTML5 Beginner

HTML Lists: ul, ol, dl, and Nested Navigation

How do I mark up unordered, ordered, and description lists?

Semantic Structure 7 min
HTML5 Beginner

HTML Images and alt Text for Accessibility and SEO

How do I write alt text that helps screen readers and image search?

Media & Performance 7 min
HTML5 Intermediate

Responsive Images with picture, srcset, and lazy Loading

How do I serve sharp images without wasting mobile bandwidth?

Media & Performance 9 min
HTML5 Intermediate

HTML Script Loading with defer, async, and type=module

How do I load JavaScript without blocking HTML parsing?

Media & Performance 8 min
HTML5 Beginner

Accessible HTML Forms, Input Types, and Native Validation

How do I build a form with labels, input types, and native validation?

Accessible Forms 8 min
HTML5 Beginner

HTML Button Types: submit, button, and reset

Why does a button submit the form when I only wanted a click?

Accessible Forms 6 min
HTML5 Intermediate

HTML Form Methods: GET versus POST

When should a form use GET instead of POST?

Accessible Forms 9 min
HTML5 Intermediate

Accessible HTML Tables with thead, tbody, and scope

How do I associate table headers with their cells?

Semantic Structure 8 min
HTML5 Intermediate

HTML data-* Attributes and the dataset API

How do I store small configuration values on an element?

Semantic Structure 7 min
HTML5 Beginner

HTML Disclosure Widgets with details and summary

How do I build a native accordion without JavaScript?

Semantic Structure 6 min
HTML5 Intermediate

Accessible Modals with the HTML dialog Element

How do I open an accessible modal with the dialog element?

Semantic Structure 8 min
HTML5 Beginner

HTML figure and figcaption for Captioned Media

How do I attach a caption to an image or a code sample?

Semantic Structure 6 min
HTML5 Beginner

HTML time Element for Dates

How do I mark a date so machines and people can both read it?

Semantic Structure 6 min
HTML5 Beginner

Fieldset and Legend for Form Groups

How do I label a group of related radio buttons?

Accessible Forms 7 min
HTML5 Intermediate

Sandboxed iframes

How do I embed a page without giving it your site privileges?

Media & Performance 8 min
HTML5 Intermediate

Open Graph Meta Tags

Which meta tags control a link preview title and image?

Document Structure 7 min
HTML5 Intermediate

The HTML template Element

How do I store inert markup to clone with JavaScript?

Semantic Structure 8 min
HTML5 Beginner

progress and meter Elements

How do I show a completion amount in HTML?

Semantic Structure 7 min
HTML5 Intermediate

Autocomplete Tokens on Inputs

How do I help browsers fill a checkout form correctly?

Accessible Forms 8 min
HTML5 Beginner

The HTML mark Element for Search Highlights

How do I mark words that matched a search?

Semantic Structure 6 min
HTML5 Beginner

HTML datalist for Suggested Input Values

How do I suggest track names without a closed dropdown?

Accessible Forms 6 min
HTML5 Intermediate

The HTML Popover API

How do I open a small note without a dialog script?

Semantic Structure 6 min
HTML5 Beginner

The HTML search Landmark

How do I mark the site search form as a landmark?

Semantic Structure 6 min
HTML5 Beginner

The HTML download Attribute

How do I offer a file save instead of navigation?

Semantic Structure 6 min
HTML5 Intermediate

inputmode for the Right Mobile Keyboard

How do I open a numeric keyboard without type=number?

Accessible Forms 6 min
HTML5 Beginner

The spellcheck Attribute

How do I turn spell checking off for code and on for prose?

Accessible Forms 6 min
HTML5 Intermediate

The HTML output Element

How do I show a calculated result inside a form?

Accessible Forms 6 min
HTML5 Intermediate

Hidden Fields and What Not to Trust

What is a hidden input for, and what must the server ignore?

Accessible Forms 6 min
HTML5 Beginner

The wbr Element for Optional Breaks

How do I let a long path wrap without adding spaces?

Semantic Structure 6 min
HTML5 Beginner

Link an external CSS file

How do I attach a stylesheet?

Basics 1 min
HTML5 Beginner

div vs span

When do I use div or span?

Basics 1 min
HTML5 Beginner

Radio button group

How do I let users pick only one option?

Forms 1 min
HTML5 Beginner

Checkboxes as PHP arrays

How do I submit multiple checkboxes to PHP?

Forms 1 min
HTML5 Beginner

Select dropdown

How do I make a dropdown menu?

Forms 1 min
HTML5 Beginner

Textarea multi-line input

How do I collect long comments?

Forms 1 min
HTML5 Beginner

Date, hidden, and file inputs

What special input types should I know?

Forms 1 min
HTML5 Beginner

Audio and video embeds

How do I embed media without Flash?

Media 1 min
HTML5 Beginner

Internal CSS with style tag

How do I put CSS inside the HTML file?

Basics 1 min
HTML5 Beginner

Semantic navigation bar

How do I mark up a site nav?

Layout 1 min
HTML5 Beginner

Explicit label for= binding

How do I connect a label to an input?

Forms 1 min
HTML5 Beginner

Figure with caption

How do I caption an image semantically?

Media 1 min
HTML5 Intermediate

Embed with iframe

How do I embed another page or map?

Components 1 min

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…