Skip to main content

HTML5 elements tester

A test page containing most of the HTML5 elements that you'll ever need. Useful for testing CSS resets or CSS frameworks.

A project by Alexander Sandberg · GitHub repository

Sections

Elements: <body>, <article>, <section>, <nav>, <aside>, <h1>–<h6>, <header>, <footer>

<h1>–<h6>:

<h1> A unique title, specific for the page

<h2> Heading levels should reflect structure, not style

It can also be useful to test how body text below a heading appears on the page, for example to check the margin. This text is wrapped in <p> and is a direct sibling to the above <h2>.

<h3> If you need a visually smaller title, use CSS

To create a semantically correct HTML structure that's accessible for everyone, make sure you're nesting the headings correctly. Never use more than one <h1> per page, and don't skip heading levels.

<h4> Headings below level 4 are not used as much

<h5> But that doesn't mean you should forget about them
<h6> And last, but not least, the heading with the lowest rank

All these tags are already in use on the page. The list below contains links to each use case. See the source code of this file for more details.

Grouping content

Elements: <p>, <address>, <hr>, <pre>, <blockquote>, <ol>, <ul>, <li>, <dl>, <dt>, <dd>, <figure>, <figcaption>, <main>, <div>

<p>:

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. [1]

<address>:

Name: Alexander Sandberg
Street adress: 1 Rover street
State: N/A
Planet: Mars
Digital home: alexandersandberg.com

<hr>:


<pre>:

Preformatted text
          will be presented
    exactly as written
          in the         HTML file.
        

<blockquote>:

The text inside this blockquote is wrapped in <p> tags. Sometimes the quote is really long, and possibly have to occupy multiple lines, but that shouldn't be a problem.

<ol> + <ul> + <li>:

  1. List item 1
  2. List item 2
    1. List item 1
  3. List item 3
    • List item 1
    • List item 2
      • List item 1
        1. List item 1
        2. List item 2
      • List item 2
    • List item 3
  4. List item 4
  • List item 1
    • List item 1
      • List item 1
    • List item 2
  • List item 2
  • List item 3
    1. List item 1
    2. List item 2

<dl> + <dt> + <dd>:

This is a term
And this is the accompanying description, explaining the above term.
You can also have multiple descriptions (<dt>), like this one, for each term (<dt>).
And why not nest lists inside this description?
Another term
With some description.
  • List item 1
  1. List item 1
  2. List item 2

<figure> + <figcaption>:

Used with an <img>:

Keanu Reeves looking fine
Wholesome Keanu Reeves from placekeanu.com.

Used with a <blockquote>:

Seek wealth, not money or status. Wealth is having assets that earn while you sleep. Money is how we transfer time and wealth. Status is your place in the social hierarchy.

Naval Ravikant (@naval) on Twitter.

<main>:

See the main content of this page for a use case of <main>.

<div>:

This paragraph of text is contained inside a <div>. The element really has no special meaning, other than grouping content together, and should be used as a last resort when no other element is suitable.

Text-level semantics

Elements: <a>, <em>, <strong>, <small>, <s>, <cite>, <q>, <dfn>, <abbr>, <ruby>, <rb>, <rt>, <rtc>, <rp>, <data>, <time>, <code>, <var>, <samp>, <kbd>, <sub>, <sup>, <i>, <b>, <u>, <mark>, <bdi>, <bdo>, <span>, <br>, <wbr>

<em> + <i> + <strong> + <b>:

The <em> element represents stress emphasis of its contents. Meanwhile, <i> is since HTML5 used for text in an alternative voice or mood, or otherwise offset from the normal prose, as you may define it.

If you want to draw attention to some text, feel free to use <b>. However, if you want to mark the importance of something, you should use <strong>.

<small> + <u> + <mark> + <s>:

When you want your text to represent small print, use <small>.

In most cases, there's a better element than <u> to use, but it can be useful for labelling msispelt text. Avoid using it, however, where the text could be confused for a hyperlink.

You can highlight text for reference purposes with <mark>, or if the contents is no longer accurate or relevant, wrap it with <s>.

<abbr> + <dfn>:

By wrapping an abbreviation like CSS in both <dfn> and <abbr>, we define the term. This can later be used only using <abbr>, since we already defined CSS once before.

<q> + <cite> + <data> + <time>:

When citing creative work, include the reference with a <cite> element. www.w3.org explains that A citation is not a quote (for which the <q> element is appropriate) instead, like used here.

If you want to link content with a machine-readable translation, use <data> with a value attribute. However, if this data is a time- or date-related, like the date , you have to use <time> together with the datatime attribute.

<code> + <var> + <samp> + <kbd> + <sub> + <sup>:

When sharing code-snippets, make sure to use the <code> element. This can be done both display: inline;, as well as block-level:

* {
color: rebeccapurple;
background: aliceblue;
}

Variables should be surrounded by <var>, or x amount of people might be confused.

Sample or quotes output are represented with <samp>: Your expression '1 + 1' equals 2.

To represent user input, like the shortcut Cmd + R on macOS, use <kbd>.

If you want to subscript or superscript text, use <sub> or <sup>.

<bdi> + <bdo> + <ruby> + <rb> + <rt> + <rtc> + <rp>:

Consider using <bdi> when working with bidirectional content, like the names Alexander and علي‎.

If you need to override the bidirectional algorithm for some content and its children, use <bdo>:

Don't forget to specify the dir attribute!

I said, don't forget to specify the dir attribute!

Some use of <ruby> and its related elements:

(Kan)(ji)
jiùjīnshānSan Francisco

More information about the explanation and usage of these can be read here on www.w3.org.

<span> + <br> + <wbr>:

A <span> can be used to mark up inline text for various uses, here to make the text bolder.

If you have really long text you might want to insert a
blank line with the <br> element. You can also insert word breaking opportunities using <wbr>, to help the browser break long words like Pneumonoultramicroscopicsilicovolcanoconiosis.

Edits

Elements: <ins>, <del>

<ins> + <del>:

If you make a really huge mistake, you can always go back and fix it later. And don't forget to learn from your mistake.

Both <ins> and <del> can be block-level, like this.

Here's a block-level paragraph removal.

Embedded content

Elements: <picture>, <source>, <img>, <iframe>, <embed>, <object>, <param>, <video>, <audio>, <track>, <map>, <area>, <math>, <svg>

<img> + <svg>:

Keanu Reeves looking fine This is a fallback message. If you see this, your browser does not support inline SVG.

<picture> + <source>:

A different image will be shown depending on viewport size.

Keanu Reeves looking fine

<iframe>:

<embed>:

<object> + <param>:

<video> + <audio> + <track>:

Audio is from an example on MDN.

Video and subtitles are from an example on MDN.

<map> + <area>:

Each side of the image below is linked to different anchors on this page. Give it a try!

Keanu Reeves looking fine

<math>:

The quadratic formula is:
x = - b ± b 2 - 4 a c 2 a

Tabular data

Elements: <table>, <caption>, <colgroup>, <col>, <tbody>, <thead>, <tfoot>, <tr>, <td>, <th>

<table> + <caption> + <colgroup> + <col>+ <tbody> + <thead> + <tfoot> + <tr> + <td> + <th>:

This is the table caption
<thead> 2nd colgroup 2nd colgroup 3rd colgroup
<tbody> This is a cell spanning two columns Last column
<tfoot> Cell 2 Cell 3 Cell 4

Forms

Elements: <form>, <label>, <input>, <button>, <select>, <datalist>, <optgroup>, <option>, <textarea>, <output>, <progress>, <meter>, <fieldset>, <legend>

<form> + <label> + <input> + <button> + <select> + <datalist> + <optgroup> + <option> + <textarea> + <fieldset> + <legend>:

Welcome to the form

<progress> + <meter>:

Testing <progress> and <meter>

Interactive elements

Elements: <details>, <summary>, <dialog>

<details> + <summary>:

This can be expanded

And by doing so, more information is revealed.

<dialog>:

This text is inside a <dialog> box! It should be hidden by default, and shown to the user when given an open attribute.

Scripting

Elements: <script>, <noscript>, <template>, <canvas>

<script> + <noscript>:

Dynamic scripts and data blocks are included with the <script> element.

If scripting is disabled when loading the page, content inside <noscript> is used instead.

<template>:

Below this paragraph, there's a <template> element containing a HTML declaration, that can be used by scripts.

<canvas>:

A <script> is used to draw a rectangle in the <canvas> below.

Alternative text explaining what's on display in this <canvas>.

Welcome to our page


The section title

The text paragraph.


Testing display of HTML elements

This page contains a bunch of HTML Elements and text. You can copy the source code and use it test out various CSS Properties. For testing purposes, you may use internal styles. Recall that these CSS rules are placed in between the head tags using the following format:

<style type="text/css">
  selector {
    property: value
  }
</style>

This is 1st level heading

This is a test paragraph.

This is 2nd level heading

This is a test paragraph.

This is 3rd level heading

This is a test paragraph.

This is 4th level heading

This is a test paragraph.

This is 5th level heading

This is a test paragraph.

This is 6th level heading

This is a test paragraph.

Basic block level elements

This is a normal paragraph (p element). To add some length to it, let us mention that this page was primarily written for testing the effect of user style sheets. You can use it for various other purposes as well, like just checking how your browser displays various HTML elements.

This is another paragraph. I think it needs to be added that the set of elements tested is not exhaustive in any sense. I have selected those elements for which it can make sense to write user style sheet rules, in my opinion.

This is a div element. Authors may use such elements instead of paragraph markup for various reasons. (End of div.)

This is a block quotation containing a single paragraph. Well, not quite, since this is not really quoted text, but I hope you understand the point. After all, this page does not use HTML markup very normally anyway.

The following contains links to the Comm-244 home page

Comm-244 Website, Week 2 page for class

Lists

This is a paragraph before an unordered list (ul). Note that the spacing between a paragraph and a list before or after that is hard to tune in a user style sheet. You can't guess which paragraphs are logically related to a list, e.g. as a "list header".







This is a paragraph before a ordered list (ol). Note that the spacing between a paragraph and a list before or after that is hard to tune in a user style sheet. You can't guess which paragraphs are logically related to a list, e.g. as a "list header".

A cute baby

A Cute Baby
  1. One.
  2. Two.
  3. Three. Well, probably this list item should be longer. Note that if items are short, lists look better if they are compactly presented, whereas for long items, it would be better to have more vertical spacing between items.
  4. Four. This is the last item in this list. Let us terminate the list now without making any more fuss about it.

Here is some text for example.

This is a paragraph before a definition list (dl). In principle, such a list should consist of terms and associated definitions. But many authors use dl elements for fancy "layout" things. Usually the effect is not too bad, if you design user style sheet rules for dl which are suitable for real definition lists.

Personal Information:
recursion
see recursion
recursion, indirect
see indirect recursion
indirect recursion
see recursion, indirect
term
a word or other expression taken into specific use in a well-defined meaning, which is often defined rather rigorously, even formally, and may differ quite a lot from an everyday meaning
Click to see details

Detailed information is here.

Back to top 👆

HTML5 Test Page

This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.

Text

Headings

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Paragraphs

A paragraph (from the Greek paragraphos, “to write beside” or “written beside”) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.

Blockquotes

A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.

It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.

Said no one, ever.

Lists

Definition list

Definition List Title
This is a definition list division.

Ordered List

  1. List Item 1
  2. List Item 2
    1. List Item 1
    2. List Item 2
      1. List Item 1
      2. List Item 2
        1. List Item 1
        2. List Item 2
          1. List Item 1
          2. List Item 2
          3. List Item 3
        3. List Item 3
      3. List Item 3
    3. List Item 3
  3. List Item 3

Unordered List

  • List Item 1
  • List Item 2
    • List Item 1
    • List Item 2
      • List Item 1
      • List Item 2
        • List Item 1
        • List Item 2
          • List Item 1
          • List Item 2
          • List Item 3
        • List Item 3
      • List Item 3
    • List Item 3
  • List Item 3

Blockquotes

A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.

It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.

Said no one, ever.

Details / Summary

Expand for details

Lorem ipsum dolor sit amet consectetur adipisicing elit. Cum, odio! Odio natus ullam ad quaerat, eaque necessitatibus, aliquid distinctio similique voluptatibus dicta consequuntur animi. Quaerat facilis quidem unde eos! Ipsa.

Address

Written by Jon Doe.
Visit us at:
Example.com
Box 564, Disneyland
USA

Tabular data

Table Caption
Table Heading 1 Table Heading 2 Table Heading 3 Table Heading 4 Table Heading 5
Table Footer 1 Table Footer 2 Table Footer 3 Table Footer 4 Table Footer 5
Table Cell 1 Table Cell 2 Table Cell 3 Table Cell 4 Table Cell 5
Table Cell 1 Table Cell 2 Table Cell 3 Table Cell 4 Table Cell 5
Table Cell 1 Table Cell 2 Table Cell 3 Table Cell 4 Table Cell 5
Table Cell 1 Table Cell 2 Table Cell 3 Table Cell 4 Table Cell 5

Code

Keyboard input: Cmd

Inline code: <div>code</div>

Sample output: This is sample output from a computer program.

Pre-formatted text

P R E F O R M A T T E D T E X T
  ! " # $ % & ' ( ) * + , - . /
  0 1 2 3 4 5 6 7 8 9 : ; < = > ?
  @ A B C D E F G H I J K L M N O
  P Q R S T U V W X Y Z [ \ ] ^ _
  ` a b c d e f g h i j k l m n o
  p q r s t u v w x y z { | } ~ 

Inline elements

This is a text link.

Strong is used to indicate strong importance.

This text has added emphasis.

The b element is stylistically different text from normal text, without any special importance.

The i element is text that is offset from the normal text.

The u element is text with an unarticulated, though explicitly rendered, non-textual annotation.

This text is deleted and This text is inserted.

This text has a strikethrough.

Superscript®.

Subscript for things like H2O.

This small text is small for fine print, etc.

Abbreviation: HTML

This text is a short inline quotation.

This is a citation.

The dfn element indicates a definition.

The mark element indicates a highlight.

The variable element, such as x = y.

The time element:

HTML Comments

There is comment here:

There is a comment spanning multiple tags and lines below here.

           

Embedded content

Images

Plain <img> element

Photo of a kitten

<figure> element with <img> element

Photo of a kitten

<figure> element with <img> and <figcaption> elements

Photo of a kitten
Here is a caption for this image.

<figure> element with a <picture> element

Photo of a kitten

Background images

Meter

2 out of 10

Progress

progress

Form elements

Input fields

[Top]

Select menus

[Top]

Checkboxes

[Top]

Radio buttons

[Top]

Textareas

[Top]

HTML5 inputs

[Top]

Action buttons

[Top]