One small page that uses every element of this section. Turn on Show tags and point at any part of
the page: a label tells you which element draws it. Click to jump to that element's details below.
Grouping contentWritten for this site
Every element of this section is in the page above. Point at one to find it, click it to read its details.
Tags with a dashed border are not drawn on the page: look for them in the code below.
<main> <search> <form> <label for="q">Search the guide</label> <input id="q" name="q" type="search" placeholder="e.g. watering"> </form> </search> <div class="card"> <h1>House plant care</h1> <p class="lead">Five minutes a week keep a house plant happy. Here is everything in one place.</p> <menu aria-label="Page tools"> <li><button type="button">Print</button></li> <li><button type="button">Share</button></li> <li><button type="button">Save</button></li> </menu> <hr> <div class="columns"> <div> <h2>What you need</h2> <ul> <li>A pot with a hole at the bottom</li> <li>Potting soil</li> <li>A watering can</li> </ul> </div> <div> <h2>Every week</h2> <ol> <li>Touch the soil.</li> <li>If it is dry, water slowly.</li> <li>Turn the pot a quarter turn.</li> </ol> </div> </div> <h2>Words to know</h2> <dl> <dt>Repotting</dt> <dd>Moving a plant into a bigger pot.</dd> <dt>Drainage</dt> <dd>Letting extra water flow out of the pot.</dd> </dl> <div class="columns"> <figure> <blockquote> <p>The best time to plant a tree was twenty years ago. The second best time is now.</p> </blockquote> <figcaption>A popular proverb</figcaption> </figure> <figure> <pre> \ | / --( * )-- / | \ | ___|___ \_____/</pre> <figcaption>A plant drawn with text: pre keeps every space.</figcaption> </figure> </div> </div></main>
MDN The <p>HTML element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields.
Live previewExample from MDN
<p> Geckos are a group of usually small, usually nocturnal lizards. They are found on every continent except Antarctica.</p><p> Some species live in houses where they hunt insects attracted by artificial light.</p>
MDN The <hr>HTML element represents a thematic break between elements: for example, a change of scene in a story, or a shift of topic within a section.
Live previewExample from MDN
<p>§1: The first rule of Fight Club is: You do not talk about Fight Club.</p><hr /><p>§2: The second rule of Fight Club is: Always bring cupcakes.</p>
MDN The <pre>HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or monospaced font.
Live previewExample from MDN
<pre> S A LUT M O N D E DONT JE SUIS LA LAN G U E É L O Q U E N TE QUESA B O U C H E O P A R I S T I R E ET TIRERA T O U JOURS AUX A L LEM ANDS - Apollinaire</pre>
MDN The <blockquote>HTML element indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element.
Live previewExample from MDN
<div> <blockquote cite="https://www.huxley.net/bnw/four.html"> <p> Words can be like X-rays, if you use them properly—they'll go through anything. You read and you're pierced. </p> </blockquote> <p>—Aldous Huxley, <cite>Brave New World</cite></p></div>
MDN The <menu>HTML element is described in the HTML specification as a semantic alternative to <ul>, but treated by browsers (and exposed through the accessibility tree) as no different than <ul>. It represents an unordered list of items (which are represented by <li> elements).
Live previewExample from MDN
<div class="news"> <a href="#">NASA's Webb Delivers Deepest Infrared Image of Universe Yet</a> <menu> <li><button id="save">Save for later</button></li> <li><button id="share">Share this news</button></li> </menu></div>
MDN The <li>HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter.
WHATWG Association list consisting of zero or more name-value groups
MDN The <dl>HTML element represents a description list. The element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs).
Live previewExample from MDN
<p>Cryptids of Cornwall:</p><dl> <dt>Beast of Bodmin</dt> <dd>A large feline inhabiting Bodmin Moor.</dd> <dt>Morgawr</dt> <dd>A sea serpent.</dd> <dt>Owlman</dt> <dd>A giant owl-like creature.</dd></dl>
MDN The <dt>HTML element specifies a term in a description or definition list, and as such must be used inside a <dl> element. It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
Live previewExample from MDN
<p>Please use the following paint colors for the new house:</p><dl> <dt>Denim (semigloss finish)</dt> <dd>Ceiling</dd> <dt>Denim (eggshell finish)</dt> <dt>Evening Sky (eggshell finish)</dt> <dd>Layered on the walls</dd></dl>
MDN The <figure>HTML element represents self-contained content, potentially with an optional caption, which is specified using the <figcaption> element. The figure, its caption, and its contents are referenced as a single unit.
Live previewExample from MDN
<figure> <img src="https://developer.mozilla.org/shared-assets/images/examples/elephant.jpg" alt="Elephant at sunset" /> <figcaption>An elephant at sunset</figcaption></figure>
MDN The <figcaption>HTML element represents a caption or legend describing the rest of the contents of its parent <figure> element, providing the <figure> an accessible name.
Live previewExample from MDN
<figure> <img src="https://developer.mozilla.org/shared-assets/images/examples/elephant.jpg" alt="Elephant at sunset" /> <figcaption>An elephant at sunset</figcaption></figure>
WHATWG Container for the dominant contents of the document
MDN The <main>HTML element represents the dominant content of the <body> of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.
Live previewExample from MDN
<header>Gecko facts</header><main> <p> Geckos are a group of usually small, usually nocturnal lizards. They are found on every continent except Antarctica. </p> <p> Many species of gecko have adhesive toe pads which enable them to climb walls and even windows. </p></main>
MDN The <search>HTML element is a container representing the parts of the document or application with form controls or other content related to performing a search or filtering operation. The <search> element semantically identifies the purpose of the element's contents as having search or filtering capabilities. The search or filtering functionality can be for the website or application, the current web page or document, or the entire Internet or subsection thereof.
WHATWG Generic flow container, or container for name-value groups in dl elements
MDN The <div>HTML element is the generic container for flow content. It has no effect on the content or layout until styled in some way using CSS (e.g., styling is directly applied to it, or some kind of layout model like Flexbox is applied to its parent element).
Live previewExample from MDN
<div class="warning"> <img src="https://developer.mozilla.org/shared-assets/images/examples/leopard.jpg" alt="An intimidating leopard." /> <p>Beware of the leopard</p></div>