Home·HTML tags

A reference of 126 HTML tags

What each tag does, whether it needs a closing tag, and the attributes you actually use — one line each.

Document skeleton5

The skeleton every document has, with a fixed order and place.

Sections17

Divides a page into meaningful blocks; search engines and screen readers follow this structure.

Text blocks7

Text that flows as a block — paragraphs, quotations, code listings.

Inline markup30

Marks up part of a line without starting a new one.

<a>A link to somewhere else; without href it is a placeholder rather than a link.<span>An inline box with no meaning, used to style part of a line differently.<strong>Marks text as important; looking bold is a side effect, not the point.<em>The part you would stress when reading aloud; italics are just how that is shown.<b>Draws attention without implying importance — use strong when it matters.<i>Text in a different voice — foreign words, scientific names, inner thoughts.<u>Underlines text that needs a non-textual annotation, such as a spelling error.<s>Strikes through content that is no longer accurate; for edit history use del.<mark>Highlights the part that matters to the reader, like a marker pen.<small>Side comments in small print — disclaimers, copyright lines.<sub>Subscript text, as in the 2 of H₂O.<sup>Superscript text, used for powers and footnote markers.<code>A fragment of code, usually shown in a monospace font.<kbd>Represents a key the user presses, such as Ctrl or Enter.<samp>Output produced by a program.<var>The name of a variable in a formula or in code.<q>A short inline quotation; the browser adds the quotation marks.<cite>Names the title of a work — not the name of a person.<abbr>An abbreviation; put the expansion in the title attribute.<time>A date or time; the datetime attribute carries the machine-readable form.<data>Attaches a machine-readable value alongside the human-readable one.<dfn>Marks the term being defined at that point in the text.<bdi>Isolates text whose direction might otherwise disturb the surrounding line.<bdo>Forces the text direction; the dir attribute is required.<ruby>Ruby annotation — pronunciation shown above characters, used with rt.<rt>Inside ruby, this holds the pronunciation itself.<rp>Fallback brackets shown by browsers that cannot render ruby.<wbr>Suggests a place where a line may break — handy inside long URLs.<ins>Content added later — used when a document keeps its edit history visible.<del>Content that was removed; pairs with ins to show an edit history.

Lists7

Ordered and unordered lists, plus term-and-definition lists.

Tables10

Data arranged in rows and columns — not a layout device.

Forms14

Controls that take a value and send it somewhere.

Media10

Images, audio, video, and surfaces you draw on.

Embedding4

Puts another document or resource inside this one.

Script and style5

Attaches behaviour and appearance to the document.

Document info2

Information read by browsers and search engines rather than people.

Disclosure3

Things that open and close on a click, with no JavaScript.

Obsolete12

Tags the standard has retired; you meet them only in old documents.

How to read this

  • Most tags come in pairs, opening and closing. Only tags with no content — img, br — are left unclosed.
  • Writing </br> for a void element does nothing useful; the browser ignores it or adds an empty line.
  • Appearance is CSS’s job. A tag says what something is; bold or italic is only the consequence.
  • Choosing the tag that matches the meaning helps search engines and screen readers alike. Wrapping everything in div throws that information away.

Frequently asked questions

Q. How many HTML tags are there?

Around 110 remain in the living standard, and roughly 130 counting the obsolete ones. This reference lists 126 — the ones in use today plus those you still meet in old documents.

Q. Which tags have no closing tag?

Those with no content: img, br, hr, input, meta, link and a few more. Writing </img> does nothing. The XHTML-style slash in <br /> is allowed but changes nothing in HTML.

Q. What is the difference between div and section?

A div is a box with no meaning; a section is a thematic group that has a heading. If a heading would fit there, use section; if you only need something to hang styles on, div is the honest choice.

Q. Can tag names be uppercase?

HTML is case-insensitive, so <DIV> works. Lowercase is the convention, and in XML-based contexts such as XHTML or SVG only lowercase is valid.

Q. What happens if I use an obsolete tag?

Most browsers still render it. But the standard has dropped it, so it may disappear at any time — and the replacements already exist: CSS for center and font, CSS animation for marquee.