HTML Reference

Core elements

Semantic & sectioning

<p>The <p> tag defines a paragraph of text, the standard way to structure body copy. <h1>–<h6>The six HTML heading levels, from <h1> (most important) to <h6> (least important), and how to use them for document outline and accessibility. <header>The <header> tag represents introductory content for its nearest ancestor, like a page's logo and nav or an article's title. <footer>The <footer> tag represents closing content for its nearest ancestor, like copyright info or an article's author details. <nav>The <nav> tag marks a section of major navigation links, such as a main menu or breadcrumb trail. <main>The <main> tag marks the primary, unique content of a document, excluding repeated headers, footers, and navigation. <section>The <section> tag groups a standalone thematic block of content, typically with its own heading. <article>The <article> tag represents a self-contained piece of content that could be distributed or reused independently. <aside>The <aside> tag marks content that's tangentially related to the surrounding content, like a sidebar or pull quote. <hr>The <hr> tag draws a horizontal rule marking a thematic break between content. <pre>The <pre> tag displays preformatted text with whitespace and line breaks preserved, in a monospace font. <blockquote>The <blockquote> tag marks an extended quotation from another source, with an optional cite URL. <address>The <address> tag marks contact information for the author or owner of an article or page. <figure> / <figcaption>The <figure> tag groups self-contained content like an image or code listing, and <figcaption> gives it a caption. <dl> / <dt> / <dd>How to build description lists in HTML using <dl>, <dt> and <dd> for name-value groups such as glossaries and metadata.

Inline text

Forms

Tables

Media & embedded

Interactive

Document metadata

Prefer everything on one page? Try the HTML cheat sheet. Want to practice now? Open the free HTML editor →