Skip to main content

HTML Elements Reference

v1.0.0

Searchable reference for HTML elements with attributes, semantics, and usage examples.

60 entries found

<<!DOCTYPE html>>Document Structure

Declares the HTML5 document type — must be the first line.

<<html>>Document Structure

The root element of every HTML page.

attrs: lang

<<head>>Document Structure

Contains metadata, links to CSS and scripts — not rendered.

<<meta>>Document Structure

Metadata: charset, viewport, description, OG tags.

attrs: charset, name, content, http-equiv

<<title>>Document Structure

Sets the title shown in browser tabs and search results.

<<link>>Document Structure

Links external resources: stylesheets, favicon, canonical.

attrs: rel, href, type, media

<<script>>Document Structure

Embeds or links JavaScript. Use defer/async for non-blocking.

attrs: src, type, defer, async, nomodule

<<style>>Document Structure

Embeds CSS rules directly in the page.

<<body>>Document Structure

Contains all visible page content.

<<header>>Sectioning

Introductory content for a page or section — logo, nav, heading.

<<nav>>Sectioning

Navigation links — major navigation blocks only.

<<main>>Sectioning

The dominant content of the page — unique per page.

<<footer>>Sectioning

Footer of a page or section — copyright, links.

<<section>>Sectioning

Thematic grouping of content with a heading.

<<article>>Sectioning

Self-contained content — blog post, comment, news story.

<<aside>>Sectioning

Tangentially related content — sidebars, pull quotes.

<<h1>–<h6>>Sectioning

Section headings. Use one h1 per page; maintain hierarchy.

<<div>>Sectioning

Generic block container — no semantic meaning.

<<span>>Sectioning

Generic inline container — no semantic meaning.

<<p>>Text

Paragraph of text.

<<strong>>Text

Strong importance — typically bold. Use for semantic weight.

<<em>>Text

Stressed emphasis — typically italic.

<<code>>Text

Inline code fragment.

<<pre>>Text

Preformatted text — preserves whitespace and line breaks.

<<blockquote>>Text

Extended quotation from another source.

attrs: cite

<<abbr>>Text

Abbreviation or acronym with optional title.

attrs: title

<<time>>Text

Date/time value — machine-readable via datetime.

attrs: datetime

<<br>>Text

Line break — use sparingly inside paragraphs.

<<hr>>Text

Thematic break between content sections.

<<mark>>Text

Highlighted text — search results, relevant content.

<<ul>>Lists

Unordered list — items have no sequence.

<<ol>>Lists

Ordered list — items have a sequence.

attrs: start, reversed, type

<<li>>Lists

List item — inside ul or ol.

attrs: value (for ol)

<<dl>>Lists

Description list — name/value pairs.

<<dt>>Lists

Description term in a dl.

<<dd>>Lists

Description detail in a dl.

<<a>>Links & Media

Hyperlink. Use rel='noopener noreferrer' for external links.

attrs: href, rel, target, download, hreflang

<<img>>Links & Media

Embeds an image. Always provide alt text.

attrs: src, alt, width, height, loading, decoding, srcset, sizes

<<picture>>Links & Media

Container for multiple image sources — responsive images.

<<source>>Links & Media

Specifies media source inside picture, video, or audio.

attrs: src, srcset, media, type

<<video>>Links & Media

Embeds video content.

attrs: src, controls, autoplay, muted, loop, poster, width, height

<<audio>>Links & Media

Embeds audio content.

attrs: src, controls, autoplay, muted, loop

<<iframe>>Links & Media

Embeds a nested browsing context.

attrs: src, title, allow, sandbox, loading

<<svg>>Links & Media

Inline SVG graphic — preferred for icons and illustrations.

<<canvas>>Links & Media

Bitmap drawing surface for 2D/WebGL graphics via JavaScript.

attrs: width, height

<<form>>Forms

Creates an interactive form.

attrs: action, method, enctype, novalidate

<<input>>Forms

Form control — text, password, email, checkbox, radio, file…

attrs: type, name, value, placeholder, required, disabled, readonly

<<textarea>>Forms

Multi-line text input.

attrs: name, rows, cols, placeholder, required

<<select>>Forms

Drop-down picker.

attrs: name, multiple, size, required

<<option>>Forms

An option inside select or datalist.

attrs: value, selected, disabled

<<label>>Forms

Caption for a form element — links via for or wrapping.

attrs: for

<<button>>Forms

Clickable button.

attrs: type (button/submit/reset), disabled, form

<<fieldset>>Forms

Groups related controls.

attrs: disabled, form

<<legend>>Forms

Caption for a fieldset.

<<table>>Tables

Tabular data — not for layout.

<<thead> / <tbody> / <tfoot>>Tables

Semantic sections of a table.

<<tr>>Tables

Table row.

<<th>>Tables

Table header cell — adds semantic meaning.

attrs: scope, colspan, rowspan

<<td>>Tables

Table data cell.

attrs: colspan, rowspan

<<caption>>Tables

Provides a title for a table.