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.
Text-level semanticsWritten 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.
<div class="board"> <p class="card"> <b class="tag">Meaning</b> <dfn><abbr title="HyperText Markup Language">HTML</abbr></dfn> is the language of web pages. Don't learn it all at once: <em>start small</em>, and <strong>practice every day</strong>. <mark>Highlighted</mark> words catch the eye. </p> <p class="card"> <b class="tag">Quotes</b> In <cite>The Web Beginner's Notebook</cite>, the author writes <q>Write the content first, style it later.</q> <small>The book is a made-up example.</small> </p> <p class="card"> <b class="tag">Computer talk</b> Press <kbd>Ctrl</kbd> + <kbd>S</kbd> and the editor answers <samp>File saved.</samp> In <code>let total = price * quantity;</code> the names <var>price</var> and <var>quantity</var> are variables. </p> <p class="card"> <b class="tag">Science</b> Water is H<sub>2</sub>O, and Einstein wrote E = mc<sup>2</sup>. </p> <p class="card"> <b class="tag">Dates and numbers</b> The workshop starts on <time datetime="2026-12-05T10:00">December 5 at 10:00</time> and costs <data value="25">twenty-five euros</data>. <s>Was forty euros.</s> </p> <p class="card"> <b class="tag">Other voices</b> The French word <i lang="fr">bonjour</i> means hello. A spelling mistake: <u class="spelling">recieve</u>. <b>Keyword:</b> markup. </p> <p class="card"> <b class="tag">Languages</b> <ruby>漢<rp>(</rp><rt>kan</rt><rp>)</rp>字<rp>(</rp><rt>ji</rt><rp>)</rp></ruby> means "Chinese characters". Top commenter: <bdi>إيان</bdi>, 3 posts. <bdo dir="rtl">This sentence is forced right to left.</bdo> </p> <p class="card"> <b class="tag">Lines and links</b> A long word breaks where you allow it: Super<wbr>cali<wbr>fragilistic<wbr>expiali<wbr>docious.<br> A line break, then a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML">link to MDN</a> and a <span class="plain">span, which means nothing on its own</span>. </p></div>
MDN The <a>HTML element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
Live previewExample from MDN
<p>You can reach Michael at:</p><ul> <li><a href="https://example.com">Website</a></li> <li><a href="mailto:m.bluth@example.com">Email</a></li> <li><a href="tel:+123456789">Phone</a></li></ul>
MDN The <em>HTML element marks text that has stress emphasis. The <em> element can be nested, with each level of nesting indicating a greater degree of emphasis.
Live previewExample from MDN
<p>Get out of bed <em>now</em>!</p><p>We <em>had</em> to do something about it.</p><p>This is <em>not</em> a drill!</p>
MDN The <strong>HTML element indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.
Live previewExample from MDN
<p> ... the most important rule, the rule you can never forget, no matter how much he cries, no matter how much he begs: <strong>never feed him after midnight</strong>.</p>
MDN The <small>HTML element represents side-comments and small print, like copyright and legal text, independent of its styled presentation. By default, it renders text within it one font-size smaller, such as from small to x-small.
Live previewExample from MDN
<p> MDN Web Docs is a learning platform for Web technologies and the software that powers the Web.</p><hr /><p> <small >The content is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.</small ></p>
MDN The <s>HTML element renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.
Live previewExample from MDN
<p><s>There will be a few tickets available at the box office tonight.</s></p><p>SOLD OUT!</p>
MDN The <cite>HTML element is used to mark up the title of a creative work. The reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata.
Live previewExample from MDN
<figure> <blockquote> <p> It was a bright cold day in April, and the clocks were striking thirteen. </p> </blockquote> <figcaption> First sentence in <cite ><a href="http://www.george-orwell.org/1984/0.html" >Nineteen Eighty-Four</a ></cite > by George Orwell (Part 1, Chapter 1). </figcaption></figure>
MDN The <q>HTML element indicates that the enclosed text is a short inline quotation. Most modern browsers implement this by surrounding the text in quotation marks. This element is intended for short quotations that don't require paragraph breaks; for long quotations use the <blockquote> element.
Live previewExample from MDN
<p> When Dave asks HAL to open the pod bay door, HAL answers: <q cite="https://www.imdb.com/title/tt0062622/quotes/?item=qt0396921&ref_=ext_shr_lnk"> I'm sorry, Dave. I'm afraid I can't do that. </q></p>
MDN The <dfn>HTML element indicates a term to be defined. The <dfn> element should be used in a complete definition statement, where the full definition of the term can be one of the following:
Live previewExample from MDN
<p> A <dfn id="def-validator">validator</dfn> is a program that checks for syntax errors in code or documents.</p>
MDN The <abbr>HTML element represents an abbreviation or acronym.
Live previewExample from MDN
<p> You can use <abbr>CSS</abbr> (Cascading Style Sheets) to style your <abbr>HTML</abbr> (HyperText Markup Language). Using style sheets, you can keep your <abbr>CSS</abbr> presentation layer and <abbr>HTML</abbr> content layer separate. This is called "separation of concerns."</p>
MDN The <ruby>HTML element represents small annotations that are rendered above, below, or next to base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating other kinds of text, but this usage is less common.
MDN The <rt>HTML element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The <rt> element must always be contained within a <ruby> element.
MDN The <rp>HTML element is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby> element. One <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text.
MDN The <data>HTML element links a given piece of content with a machine-readable translation. If the content is time- or date-related, the <time> element must be used.
WHATWG Machine-readable equivalent of date- or time-related data
MDN The <time>HTML element represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.
Live previewExample from MDN
<p> The Cure will be celebrating their 40th anniversary on <time datetime="2018-07-07">July 7</time> in London's Hyde Park.</p><p> The concert starts at <time datetime="20:00">20:00</time> and you'll be able to enjoy the band for at least <time datetime="PT2H30M">2h 30m</time>.</p>
MDN The <code>HTML element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code. By default, the content text is displayed using the user agent's default monospace font.
Live previewExample from MDN
<p> The <code>push()</code> method adds one or more elements to the end of an array and returns the new length of the array.</p>
MDN The <var>HTML element represents the name of a variable in a mathematical expression or a programming context. It's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent.
Live previewExample from MDN
<p> The volume of a box is <var>l</var> × <var>w</var> × <var>h</var>, where <var>l</var> represents the length, <var>w</var> the width and <var>h</var> the height of the box.</p>
MDN The <samp>HTML element is used to enclose inline text which represents sample (or quoted) output from a computer program. Its contents are typically rendered using the browser's default monospaced font (such as Courier>) or Lucida Console).
Live previewExample from MDN
<p>I was trying to boot my computer, but I got this hilarious message:</p><p> <samp>Keyboard not found <br />Press F1 to continue</samp></p>
MDN The <kbd>HTML element represents user input (typically keyboard input). By default, the content text is displayed using the user agent's default monospace font.
Live previewExample from MDN
<p> Please press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> to re-render an MDN page.</p>
MDN The <sub>HTML element specifies inline text which should be displayed as subscript for solely typographical reasons. Subscripts are typically rendered with a lowered baseline using smaller text.
Live previewExample from MDN
<p> Almost every developer's favorite molecule is C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>, also known as "caffeine."</p>
MDN The <sup>HTML element specifies inline text which is to be displayed as superscript for solely typographical reasons. Superscripts are usually rendered with a raised baseline using smaller text.
Live previewExample from MDN
<p> The <em>Pythagorean theorem</em> is often expressed as the following equation:</p><p> <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> = <var>c<sup>2</sup></var></p>
MDN The <i>HTML element represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the <i> naming of this element.
Live previewExample from MDN
<p>I looked at it and thought <i>This can't be real!</i></p><p> <i>Musa</i> is one of two or three genera in the family <i>Musaceae</i>; it includes bananas and plantains.</p><p> The term <i>bandwidth</i> describes the measure of how much information can pass through a data connection in a given amount of time.</p>
MDN The <b>HTML element is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface. However, you should not use <b> for styling text or granting importance. If you wish to create boldface text, you should use the CSS font-weight property. If you wish to indicate an element is of special importance, you should use the <strong> element.
Live previewExample from MDN
<p> The two most popular science courses offered by the school are <b class="term">chemistry</b> (the study of chemicals and the composition of substances) and <b class="term">physics</b> (the study of the nature and properties of matter and energy).</p>
MDN The <u>HTML element represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. This is rendered by default as a single solid underline, but may be altered using CSS.
Live previewExample from MDN
<p> You could use this element to highlight <u>speling</u> mistakes, so the writer can <u>corect</u> them.</p>
p { margin: 0;}u { text-decoration: red wavy underline;}
MDN The <mark>HTML element represents text which is marked or highlighted for reference or notation purposes due to the marked passage's relevance in the enclosing context.
Live previewExample from MDN
<p>Search results for "salamander":</p><hr /><p> Several species of <mark>salamander</mark> inhabit the temperate rainforest of the Pacific Northwest.</p><p> Most <mark>salamander</mark>s are nocturnal, and hunt for insects, worms, and other small creatures.</p>
MDN The <bdi>HTML element tells the browser's bidirectional algorithm to treat the text it contains in isolation from its surrounding text. It's particularly useful when a website dynamically inserts some text and doesn't know the directionality of the text being inserted.
MDN The <bdo>HTML element overrides the current directionality of text, so that the text within is rendered in a different direction.
Live previewExample from MDN
<h1>Famous seaside songs</h1><p>The English song "Oh I do like to be beside the seaside"</p><p> Looks like this in Hebrew: <span dir="rtl">אה, אני אוהב להיות ליד חוף הים</span></p><p> In the computer's memory, this is stored as <bdo dir="ltr">אה, אני אוהב להיות ליד חוף הים</bdo></p>
html { font-family: sans-serif;}bdo { /* Add your styles here */}
MDN The <span>HTML element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. <span> is very much like a <div> element, but <div> is a block-level element whereas a <span> is an inline-level element.
Live previewExample from MDN
<p> Add the <span class="ingredient">basil</span>, <span class="ingredient">pine nuts</span> and <span class="ingredient">garlic</span> to a blender and blend into a paste.</p><p> Gradually add the <span class="ingredient">olive oil</span> while running the blender slowly.</p>
MDN The <br>HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
Live previewExample from MDN
<p> O'er all the hilltops<br /> Is quiet now,<br /> In all the treetops<br /> Hearest thou<br /> Hardly a breath;<br /> The birds are asleep in the trees:<br /> Wait, soon like these<br /> Thou too shalt rest.</p>
p { font-size: 1rem; font-family: sans-serif; margin: 20px;}
MDN The <wbr>HTML element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.