HTML tags are the building blocks of every web page. This reference lists the tags you use most, grouped by purpose, with a short note on what each one does.
Document structure
| Tag | What it does |
|---|---|
<html> |
Root of the page |
<head> |
Metadata, not shown on the page |
<body> |
Visible page content |
<title> |
The page title in the tab and search |
<meta> |
Metadata such as charset and description |
<link> |
Link to a stylesheet or icon |
<script> |
JavaScript |
Text & headings
| Tag | What it does |
|---|---|
<h1> to <h6> |
Headings, h1 the most important |
<p> |
A paragraph |
<br> |
A line break |
<hr> |
A thematic divider |
<strong> |
Important text (bold) |
<em> |
Emphasis (italic) |
<blockquote> |
A quoted block |
<code> |
Inline code |
<pre> |
Preformatted text |
Lists & tables
| Tag | What it does |
|---|---|
<ul> / <ol> |
Unordered / ordered list |
<li> |
A list item |
<table> |
A table |
<tr> |
A table row |
<th> / <td> |
Header cell / data cell |
Links & media
| Tag | What it does |
|---|---|
<a href> |
A hyperlink |
<img src alt> |
An image |
<video> / <audio> |
Embedded media |
<iframe> |
Embed another page |
<picture> |
Responsive images |
Forms
| Tag | What it does |
|---|---|
<form> |
A form |
<input> |
An input field |
<textarea> |
A multi-line input |
<select> / <option> |
A dropdown |
<button> |
A clickable button |
<label> |
A label for an input |
Semantic layout
| Tag | What it does |
|---|---|
<header> |
Top of a page or section |
<nav> |
Navigation links |
<main> |
The main content |
<section> |
A thematic group |
<article> |
Self-contained content |
<aside> |
Side content |
<footer> |
Bottom of a page or section |
Frequently Asked Questions
What is an HTML tag?
An HTML tag is a keyword in angle brackets that defines an element on a page, such as a paragraph, a link, or an image.
What is the difference between block and inline tags?
Block tags like p and div start on a new line and fill the width. Inline tags like span and a sit within a line of text.
What are semantic HTML tags?
Semantic tags such as header, nav, main, and footer describe the meaning of their content, which helps accessibility and SEO.
Do all tags need a closing tag?
Most do, but some are self-closing void elements, such as img, br, hr, and input, which have no content.
Browse our full set of free developer tools for formatting, converting, and inspecting code.