Practical reference

HTML elements in real pages

Concise definitions followed by tested context, accessibility consequences, and common misuse.

reference · beginner

HTML global attributes

Use attributes shared across HTML elements for identity, language, state, editing, focus, hidden content, data hooks, and accessibility.

Open resource

reference · beginner

The anchor element

Create crawlable, keyboard-accessible links with meaningful destination text, valid URLs, and safe external-link behavior.

Open resource

reference · intermediate

The audio element

Embed audio with native playback controls, declared formats, transcript access, restrained loading, and clear failure recovery.

Open resource

reference · beginner

The button element

Use a native button for actions, form submission, disclosure controls, and other interactions that occur on the current page.

Open resource

reference · advanced

The canvas element

Use canvas for script-drawn bitmap graphics only when its fallback content, interaction model, scaling, and accessibility are deliberately handled.

Open resource

reference · beginner

The datalist element

datalist attaches native autocomplete suggestions to a text input, giving users options without restricting them to a fixed list.

Open resource

reference · intermediate

The dialog element

Present a focused modal or nonmodal dialog with a clear name, deliberate opening, contained interaction, close behavior, and focus return.

Open resource

reference · beginner

The div element

Use div as a block-level grouping hook when no semantic sectioning, landmark, list, or text element describes the content.

Open resource

reference · beginner

HTML form elements

Collect user input with form, label, input, textarea, select, button, fieldset, and legend while preserving clear relationships.

Open resource

reference · beginner

The head element

head holds the document metadata a browser needs before rendering: charset, title, viewport, stylesheets, and canonical declarations.

Open resource

reference · beginner

The HTML root element

Use the html element as the document root and declare the page language so browsers and assistive technology interpret content correctly.

Open resource

reference · advanced

The iframe element

Embed a separate browsing context only when necessary, with a useful title, bounded permissions, sandbox policy, loading plan, and fallback.

Open resource

reference · beginner

The img element

Embed an image with a purposeful text alternative, intrinsic dimensions, responsive source behavior, and controlled loading.

Open resource

reference · beginner

The input element

Collect a bounded value with an input whose type, label, name, autocomplete, constraints, and error behavior match the task.

Open resource

reference · beginner

HTML input types

Choose an input type by the value and interaction required, while planning for browser variation, validation, and accessible recovery.

Open resource

reference · beginner

The label element

Use label to give a form control a persistent visible name and a larger pointer target through an explicit or implicit association.

Open resource

reference · intermediate

The link element

Use link in document metadata to connect stylesheets, canonical URLs, icons, manifests, feeds, and performance hints to the current page.

Open resource

reference · beginner

The meta element

Add document metadata such as encoding, viewport behavior, and descriptions without treating metadata as a ranking guarantee.

Open resource

reference · intermediate

The picture element

Provide art-directed image sources or format alternatives while preserving one accessible img fallback, dimensions, and responsive behavior.

Open resource

reference · intermediate

The script element

Use script to load or embed executable JavaScript or data, with deliberate loading order, security policy, and no-script behavior.

Open resource

reference · beginner

The select element

Offer a bounded list of options with native selection, labeling, grouping, form submission, keyboard behavior, and recoverable validation.

Open resource

reference · intermediate

The source element

Use source to offer alternate image, audio, or video resources so the browser can select a compatible or responsive candidate.

Open resource

reference · intermediate

Inline SVG in HTML

Use inline SVG for scalable graphics that need document-level styling, scripting, or accessible naming, while keeping decorative art silent.

Open resource

reference · intermediate

The template element

Use template to store inert DOM fragments that scripts can clone, while keeping required content and behavior available without fragile injection.

Open resource

reference · beginner

The textarea element

Collect multi-line plain text with a persistent label, useful size guidance, bounded submission, and accessible validation feedback.

Open resource

reference · beginner

The title element

title names the document for browser tabs, bookmarks, search results, and screen reader announcements. Every page needs exactly one.

Open resource

reference · intermediate

The track element

Use track with audio or video to provide timed captions, subtitles, descriptions, chapters, or metadata in WebVTT.

Open resource

reference · intermediate

The video element

Embed video with native controls, declared sources, captions, fallback content, responsive sizing, and deliberate loading behavior.

Open resource