Web Development · HTML

Complete List of HTML Tags (with Meaning)

All 121 HTML tags in one place, grouped by use, each with a simple one-line meaning. Old tags that you should not use any more are shown in red at the end.

Page structure

<!DOCTYPE>Tells the browser this is an HTML5 page. Always the first line.
<html>The root that wraps the whole page.
<head>Holds page info (title, CSS, meta) that is not shown on the page.
<title>The page title shown in the browser tab and on Google.
<meta>Extra page info, like description, charset and mobile viewport.
<link>Connects outside files, mostly CSS and the favicon.
<style>Write CSS directly inside the page.
<script>Adds JavaScript.
<noscript>Shown only if JavaScript is turned off.
<base>Sets the base URL for all links on the page.
<body>Everything visible on the page goes here.
<!--...-->A comment. Notes for you, not shown on the page.

Layout and sections

<header>Top part of a page or section (logo, menu).
<nav>A block of navigation links.
<main>The main content of the page (use once).
<section>A themed group of content.
<article>Content that stands alone, like a blog post.
<aside>Side content, like a sidebar.
<footer>Bottom part of a page or section.
<div>A general box for grouping and styling.
<span>A general inline wrapper for a few words.
<address>Contact details.
<search>Wraps a search form.
<template>Hidden HTML that JavaScript can copy later.
<dialog>A popup box or modal.
<details>A box the user can open and close.
<summary>The clickable heading of <details>.

Text

<h1> to <h6>Headings. h1 is the biggest and most important.
<p>A paragraph.
<br>A line break.
<hr>A horizontal line / topic break.
<b>Bold text (style only).
<strong>Important text, shown bold.
<i>Italic text (style only).
<em>Stressed text, shown italic.
<u>Underlined text.
<s>Text that is no longer correct (strikethrough).
<mark>Highlighted text.
<small>Small print, like copyright.
<sub>Subscript, like H2O.
<sup>Superscript, like x2.
<blockquote>A long quote from another source.
<q>A short inline quote.
<cite>Title of a book, film or work.
<abbr>An abbreviation, like HTML.
<dfn>The term being defined.
<code>A piece of code.
<pre>Text that keeps its spaces and line breaks.
<kbd>Keyboard keys, like Ctrl + C.
<samp>Sample output from a program.
<var>A variable in maths or code.
<time>A date or time.
<data>A value with a machine-readable version.
<del>Deleted text.
<ins>Inserted text.
<bdi>Keeps text direction separate (useful for Urdu/Arabic names).
<bdo>Forces text direction (left-to-right or right-to-left).
<wbr>A spot where a long word may break.
<ruby>Small notes above text (East Asian pronunciation).
<rt>The note text inside <ruby>.
<rp>Fallback brackets for <ruby>.

Links, images and media

<a>A link to another page or file.
<img>Shows an image.
<picture>Gives different images for different screens.
<source>A file choice for <picture>, <video> or <audio>.
<figure>Wraps an image or diagram.
<figcaption>Caption for a <figure>.
<video>Plays a video.
<audio>Plays sound.
<track>Subtitles for video/audio.
<iframe>Shows another page inside yours (e.g. YouTube video).
<embed>Embeds outside content.
<object>Embeds an outside file.
<map>An image with clickable areas.
<area>One clickable area inside <map>.
<canvas>A drawing area for JavaScript graphics and games.
<svg>Sharp vector graphics and icons.

Lists

<ul>A bullet list.
<ol>A numbered list.
<li>One item in a list.
<dl>A description list.
<dt>A term in a <dl>.
<dd>The description of a term.
<menu>A simple list of commands.

Tables

<table>A table.
<caption>Title of a table.
<thead>Header rows of a table.
<tbody>Main rows of a table.
<tfoot>Footer rows of a table.
<tr>One table row.
<th>A header cell.
<td>A normal cell.
<colgroup>Groups table columns.
<col>Styles one column.

Forms

<form>A form that sends user input.
<input>A box for typing, checkbox, button and more.
<textarea>A big box for multi-line text.
<button>A clickable button.
<select>A dropdown list.
<option>One choice in a dropdown.
<optgroup>Groups options in a dropdown.
<label>Name for a form field.
<fieldset>Groups related fields.
<legend>Title for a <fieldset>.
<datalist>Suggestions for an input box.
<output>Shows a result of a calculation.
<progress>A progress bar.
<meter>A gauge, like battery level.

Old tags (don't use)

<acronym>Old. Use <abbr>.
<applet>Old Java applets. Use <object>.
<basefont>Old. Use CSS.
<big>Old. Use CSS font-size.
<center>Old. Use CSS text-align: center.
<dir>Old. Use <ul>.
<font>Old. Use CSS.
<frame>Old. Use <iframe>.
<frameset>Old. Use CSS layout.
<noframes>Old, not needed.
<param>Old, was used with <object>.
<strike>Old. Use <s> or <del>.
<tt>Old. Use <code> or CSS.
Tip: Most pages use only about 20 tags: html, head, title, meta, link, body, header, nav, main, footer, h1–h6, p, a, img, ul, li, div, span, button and form. Learn these first.

← Back to Web Development