Essential tags that form the foundation of every HTML document
The <html> tag is the root element of an HTML document.
Example: <html lang="en">...</html>
The <head> tag contains metadata and links to resources.
Example: <head><title>Title</title></head>
The <body> tag defines the main content of an HTML document.
Example: <body>Content here</body>
The <title> tag defines the title of the document (shown in browser tab).
Example: <title>Page Title</title>
The <meta> tag provides metadata about the HTML document.
Example: <meta charset="UTF-8">
The <link> tag defines a link to an external resource (like a stylesheet).
Example: <link rel="stylesheet" href="style.css">
Basic tags for displaying text and creating document structure
The <h1> tag defines a top-level heading on a webpage. Headings range from <h1> to <h6>.
Example: <h1>This is a Heading</h1>
Live Example:
The <hgroup> tag groups a heading with subheadings or secondary content. Previously deprecated, it has been reinstated in HTML Living Standard.
Example: <hgroup><h1>Title</h1><p>Subtitle</p></hgroup>
Live Example:
A descriptive subtitle or tagline
The <p> tag defines a paragraph of text.
Example: <p>This is a paragraph.</p>
Live Example:
This is a paragraph.
The <br> tag inserts a line break.
Example: Line one<br>Line two
Live Example:
The <hr> tag creates a horizontal line (thematic break).
Example: <hr>
Live Example:
Tags for styling, emphasizing, and giving meaning to text content
The <strong> tag defines text with strong importance (typically bold).
Example: <strong>Important text</strong>
Live Example: This is Important text in a sentence.
The <em> tag defines emphasized text (typically italic).
Example: <em>Emphasized text</em>
Live Example: This is Emphasized text in a sentence.
The <b> tag makes text bold without adding extra importance.
Example: <b>Bold text</b>
Live Example: This is Bold text in a sentence.
The <i> tag makes text italic without adding emphasis.
Example: <i>Italic text</i>
Live Example: This is Italic text in a sentence.
The <u> tag underlines text.
Example: <u>Underlined text</u>
Live Example: This is Underlined text in a sentence.
The <mark> tag highlights or marks text for reference or notation purposes.
Example: <mark>highlighted text</mark>
Live Example: This is highlighted text in a sentence.
The <small> tag represents side comments or small print (like copyright or legal text).
Example: <small>Copyright 2026</small>
Live Example: Copyright © 2026. All rights reserved.
The <sub> tag creates subscript text, while <sup> creates superscript text.
Example: H<sub>2</sub>O or x<sup>2</sup>
Live Example: H2O (water) and E=mc2 (Einstein's equation)
The <code> tag defines a piece of computer code.
Example: <code>console.log()</code>
Live Example: Use console.log() to print output.
The <kbd> tag represents keyboard input or user input from other sources.
Example: Press <kbd>Ctrl</kbd> + <kbd>C</kbd>
Live Example: Press Ctrl + C to copy.
The <abbr> tag defines an abbreviation or acronym, with an optional title for the full description.
Example: <abbr title="HyperText Markup Language">HTML</abbr>
Live Example: HTML (hover to see full text)
The <time> tag represents a specific time or date in a machine-readable format.
Example: <time datetime="2026-01-03">January 3, 2026</time>
Live Example: The event is on .
The <wbr> tag suggests where text can break if needed (for long words or URLs).
Example: verylongword<wbr>continuation
Live Example:
The <pre> tag defines preformatted text (preserves spaces and line breaks).
Example: <pre>Formatted text</pre>
Live Example:
Line 1
Indented Line 2
More indented Line 3
The <blockquote> tag defines a section quoted from another source.
Example: <blockquote>Quote here</blockquote>
Live Example:
"This is a quotation from another source."
Tags for hyperlinks, images, video, audio, and embedded content
The <a> tag defines a hyperlink, which is used to link from one page to another.
Example: <a href="https://example.com">Visit Example</a>
Live Example: Visit Example
The <img> tag is used to embed an image in a webpage.
Example: <img src="image.jpg" alt="Image description">
Live Example:
The <picture> tag contains multiple <source> elements for responsive images that adapt to different screen sizes.
Example: <picture><source media="(min-width: 800px)" srcset="large.jpg"><img src="small.jpg"></picture>
Live Example:
Resize your browser to see the image change!
The <figure> tag groups media content with a caption defined by <figcaption>.
Example: <figure><img src="photo.jpg"><figcaption>Caption</figcaption></figure>
Live Example:
The <video> tag embeds video content in a webpage.
Example: <video src="video.mp4" controls></video>
The <audio> tag embeds audio content in a webpage.
Example: <audio src="audio.mp3" controls></audio>
The <iframe> tag embeds another HTML page within the current page.
Example: <iframe src="page.html"></iframe>
Tags for creating ordered and unordered lists
The <ul> tag defines an unordered (bulleted) list.
Example: <ul><li>Item 1</li><li>Item 2</li></ul>
Live Example:
The <ol> tag defines an ordered (numbered) list.
Example: <ol><li>First</li><li>Second</li></ol>
Live Example:
The <li> tag defines an item in a list (used with <ul> or <ol>).
Example: <li>List item</li>
Semantic HTML5 tags for organizing page layout and content structure
The <div> tag is a block-level container for content, typically used to group elements.
Example: <div>Content here</div>
The <span> tag is an inline container used to style or manipulate a specific part of text.
Example: <span style="color:red">Red text</span>
The <header> tag defines a header section for a document or section.
Example: <header><h1>Site Title</h1></header>
The <footer> tag defines a footer section for a document or section.
Example: <footer>© 2026</footer>
The <nav> tag defines a section of navigation links.
Example: <nav><a href="/home">Home</a></nav>
The <main> tag specifies the main content of a document.
Example: <main>Main content here</main>
The <section> tag defines a thematic grouping of content.
Example: <section><h2>About</h2>...</section>
The <article> tag defines independent, self-contained content.
Example: <article><h2>Article Title</h2>...</article>
The <aside> tag defines content aside from the main content (like a sidebar).
Example: <aside>Related links...</aside>
The <menu> tag represents a toolbar or menu of commands. It can contain list items or other menu content.
Example: <menu><li><button>Copy</button></li><li><button>Paste</button></li></menu>
Live Example:
Tags for creating and structuring data tables
The <table> tag defines a table for displaying data in rows and columns.
Example: <table><tr><td>Data</td></tr></table>
Live Example:
| Name | Age |
|---|---|
| John | 25 |
| Jane | 30 |
The <tr> tag defines a row in a table.
Example: <tr><td>Cell 1</td><td>Cell 2</td></tr>
The <td> tag defines a standard data cell in a table.
Example: <td>Table data</td>
The <th> tag defines a header cell in a table.
Example: <th>Column Header</th>
Tags for creating interactive forms and user input elements
The <form> tag defines an HTML form for user input.
Example: <form action="/submit">...</form>
The <input> tag defines an input field where users can enter data. It has many types and can be easily styled with CSS.
Example: <input type="text" name="username">
Common Input Types:
CSS Tip: Use :focus, :hover, and transition for smooth interactions!
The <button> tag defines a clickable button.
Example: <button>Click me</button>
Live Example:
The <label> tag defines a label for an input element.
Example: <label for="email">Email:</label>
The <select> tag creates a dropdown list.
Example: <select><option>Option 1</option></select>
Live Example:
The <option> tag defines an option in a dropdown list.
Example: <option value="1">Option 1</option>
The <textarea> tag defines a multi-line text input control.
Example: <textarea rows="4" cols="50"></textarea>
Live Example:
The <datalist> tag provides a list of predefined options for an input element (autocomplete).
Example: <input list="browsers"><datalist id="browsers">...</datalist>
Live Example:
The <output> tag represents the result of a calculation or user action.
Example: <output>Result: 42</output>
Live Example:
Modern HTML5 tags that provide meaning to document structure
The <header> tag defines a header section for a document or section.
Example: <header><h1>Site Title</h1></header>
The <footer> tag defines a footer section for a document or section.
Example: <footer>© 2026</footer>
The <nav> tag defines a section of navigation links.
Example: <nav><a href="/home">Home</a></nav>
The <main> tag specifies the main content of a document.
Example: <main>Main content here</main>
The <section> tag defines a thematic grouping of content.
Example: <section><h2>About</h2>...</section>
The <article> tag defines independent, self-contained content.
Example: <article><h2>Article Title</h2>...</article>
The <aside> tag defines content aside from the main content (like a sidebar).
Example: <aside>Related links...</aside>
Contemporary HTML5 tags for interactive and enhanced user experiences
The <details> tag creates a disclosure widget that can be toggled open/closed. <summary> provides the visible heading.
Example: <details><summary>Click to expand</summary>Hidden content</details>
Live Example:
This content is hidden until you click the summary!
Multiple <details> elements with the same name attribute behave like radio buttons - only one can be open at a time.
Example: <details name="accordion"><summary>Section 1</summary>...</details>
Live Example:
Content for section 1. Try opening another section!
Content for section 2. Opening this closes Section 1.
Content for section 3. This is an accordion pattern!
The <dialog> tag represents a dialog box or modal window.
Example: <dialog id="myDialog">This is a dialog</dialog>
Live Example:
The <mark> tag highlights or marks text for reference or notation purposes.
Example: <mark>highlighted text</mark>
Live Example: This is highlighted text in a sentence.
The <progress> tag represents the progress of a task.
Example: <progress value="70" max="100"></progress>
Live Example:
70% complete
The <meter> tag represents a scalar measurement within a known range (like a gauge).
Example: <meter value="6" min="0" max="10"></meter>
Live Example:
6 out of 10
The <time> tag represents a specific time or date in a machine-readable format.
Example: <time datetime="2026-01-03">January 3, 2026</time>
Live Example: The event is on .
The <datalist> tag provides a list of predefined options for an input element (autocomplete).
Example: <input list="browsers"><datalist id="browsers">...</datalist>
Live Example:
The <figure> tag groups media content with a caption defined by <figcaption>.
Example: <figure><img src="photo.jpg"><figcaption>Caption</figcaption></figure>
Live Example:
The <output> tag represents the result of a calculation or user action.
Example: <output>Result: 42</output>
Live Example:
The <picture> tag contains multiple <source> elements for responsive images that adapt to different screen sizes.
Example: <picture><source media="(min-width: 800px)" srcset="large.jpg"><img src="small.jpg"></picture>
Live Example:
Resize your browser to see the image change!
The <template> tag holds HTML content that is not rendered when the page loads but can be cloned and inserted via JavaScript.
Example: <template id="myTemplate"><p>Template content</p></template>
Visual Note: Templates are invisible by default and used for JavaScript templating.
The <kbd> tag represents keyboard input or user input from other sources.
Example: Press <kbd>Ctrl</kbd> + <kbd>C</kbd>
Live Example: Press Ctrl + C to copy.
The <abbr> tag defines an abbreviation or acronym, with an optional title for the full description.
Example: <abbr title="HyperText Markup Language">HTML</abbr>
Live Example: HTML (hover to see full text)
The <wbr> tag suggests where text can break if needed (for long words or URLs).
Example: verylongword<wbr>continuation
Live Example:
The <sub> tag creates subscript text, while <sup> creates superscript text.
Example: H<sub>2</sub>O or x<sup>2</sup>
Live Example: H2O (water) and E=mc2 (Einstein's equation)
The <small> tag represents side comments or small print (like copyright or legal text).
Example: <small>Copyright 2026</small>
Live Example: Copyright © 2026. All rights reserved.
Tags for JavaScript, CSS, dynamic content, and graphics rendering
The <script> tag embeds or references JavaScript code.
Example: <script src="script.js"></script>
The <style> tag defines CSS styles for a document.
Example: <style>body { color: blue; }</style>
The <template> tag holds HTML content that is not rendered when the page loads but can be cloned and inserted via JavaScript.
Example: <template id="myTemplate"><div>Template content</div></template>
Live Example:
This was hidden in a template tag!
The <canvas> tag is used to draw graphics via JavaScript.
Example: <canvas id="myCanvas" width="200" height="100"></canvas>
Live Example:
The <svg> tag defines Scalable Vector Graphics.
Example: <svg width="100" height="100"><circle cx="50" cy="50" r="40" fill="blue"/></svg>
Live Example: