April 1, 2025 By MarketingSA Off

Complete list of HTML5 Tags

Document Structure

  1. <!DOCTYPE>: Declares the document type and HTML version
  2. <html>: Root element of an HTML page
  3. <head>: Contains metadata and document info
  4. <title>: Specifies the title of the document
  5. <body>: Contains the visible page content

Semantic Tags (HTML5)

1. Document Structure

  • Tag

    Description

    Example

    <header>

    Introductory content for a section or page (e.g., logo, navigation).

    <header><h1>Website Title</h1></header>

    <footer>

    Footer content for a section or page (e.g., copyright, contact info).

    <footer>&copy; 2023 My Site</footer>

    <nav>

    Navigation links (menus, tables of contents).

    <nav><a href="/home">Home</a></nav>

    <main>

    Primary content of the document (only one per page).

    <main><article>...</article></main>


    2. Content Sections

    Tag

    Description

    Example

    <article>

    Self-contained content (e.g., blog post, news article).

    <article><h2>Blog Post Title</h2><p>Content...</p></article>

    <section>

    Thematic grouping of content (e.g., chapters, tabs).

    <section><h2>Chapter 1</h2><p>Text...</p></section>

    <aside>

    Content indirectly related to the main content (e.g., sidebars, ads).

    <aside><h3>Related Links</h3></aside>


    3. Media & Figures

    Tag

    Description

    Example

    <figure>

    Self-contained media (e.g., images, diagrams, code snippets).

    <figure><img src="image.jpg"><figcaption>Caption</figcaption></figure>

    <figcaption>

    Caption for a <figure>.

    See above.


    4. Text Semantics

    Tag

    Description

    Example

    <time>

    Represents a date/time (machine-readable).

    <time datetime="2023-10-05">October 5, 2023</time>

    <mark>

    Highlighted text (e.g., search results).

    <mark>Highlighted text</mark>

    <small>

    Fine print (disclaimers, copyrights).

    <small>&copy; 2023 My Site</small>

    <address>

    Contact information for the page/section author.

    <address>Contact: <a href="mailto:me@example.com">Email</a></address>


    5. Interactive Elements

    Tag

    Description

    Example

    <details>

    Collapsible widget with toggleable content.

    <details><summary>Click Me</summary><p>Hidden content</p></details>

    <summary>

    Heading for a <details> element.

    See above.

    <dialog>

    Popup/modal dialog box.

    <dialog open><p>Hello! I'm a dialog.</p></dialog>


    6. Data Representation

    Tag

    Description

    Example

    <progress>

    Progress indicator (e.g., file upload).

    <progress value="70" max="100">70%</progress>

    <meter>

    Scalar measurement within a range (e.g., disk usage).

    <meter value="3" min="0" max="10">3/10</meter>


    7. Text Annotations

    Tag

    Description

    Example

    <ruby>

    Ruby annotations (for East Asian typography).

    <ruby>漢 <rt>Kan</rt></ruby>

    <rt>

    Pronunciation/text for <ruby> annotations.

    See above.

    <rp>

    Fallback parentheses for browsers without ruby support.

    <ruby>漢 <rp>(</rp><rt>Kan</rt><rp>)</rp></ruby>


    8. Bidirectional Text

    Tag

    Description

    Example

    <bdi>

    Isolates text direction (e.g., user-generated content in mixed languages).

    <bdi>إيان</bdi> wrote this.

    <bdo>

    Overrides text direction (use dir="rtl" or dir="ltr").

    <bdo dir="rtl">This text is reversed.</bdo>


    9. Word Breaks

    Tag

    Description

    Example

    <wbr>

    Suggests a word break opportunity in long words/URLs.

    https://example.com/<wbr>very-long-path


    Best Practices

    1. Use semantic tags instead of generic <div>/<span> where possible.

    2. Avoid nesting multiple <article>/<section> tags without headings.

    3. Use one <main> per page for primary content.

    4. Combine with ARIA roles for enhanced accessibility.


    Deprecated Tags to Avoid

    1. <center>, <font>, <big>, <strike> (use CSS or semantic tags instead).


    By using these tags, you improve accessibility (screen readers), SEO (search engines), and code readability. Let me know if you need examples for specific use cases! 🚀


Metadata

  1. <meta>: Metadata about the document (e.g., charset, viewport)
  2. <link>: Links to external resources (e.g., CSS)
  3. <style>: Embedded CSS styles
  4. <script>: Client-side JavaScript code
  5. <base>: Base URL for relative URLs

Text Formatting

  1. <h1> to <h6>: Headings
  2. <p>: Paragraph
  3. <br>: Line break
  4. <hr>: Thematic break (horizontal line)
  5. <pre>: Preformatted text
  6. <blockquote>: Long quotation
  7. <q>: Short inline quotation
  8. <code>: Code snippet
  9. <em>: Emphasized text
  10. <strong>: Important text
  11. <i>: Italicized text (e.g., technical terms)
  12. <b>: Bold text (stylistic)
  13. <u>: Underlined text
  14. <sub>: Subscript text
  15. <sup>: Superscript text
  16. <small>: Smaller text (e.g., disclaimers)
  17. <span>: Inline container for styling

Lists

  1. <ul>: Unordered list
  2. <ol>: Ordered list
  3. <li>: List item
  4. <dl>: Description list
  5. <dt>: Term in a description list
  6. <dd>: Description of a term

Links & Media

  1. <a>: Hyperlink
  2. <img>: Embeds an image
  3. <audio>: Embeds audio
  4. <video>: Embeds video
  5. <source>: Media source for <audio>/<video>
  6. <track>: Text tracks for media (e.g., subtitles)
  7. <embed>: Embeds external content (e.g., plugins)
  8. <object>: Embeds external resource
  9. <iframe>: Embeds another HTML page

Tables

  1. <table>: Defines a table
  2. <tr>: Table row
  3. <th>: Table header cell
  4. <td>: Table data cell
  5. <thead>: Groups header content in a table
  6. <tbody>: Groups body content in a table
  7. <tfoot>: Groups footer content in a table
  8. <caption>: Table caption
  9. <colgroup>: Groups table columns
  10. <col>: Specifies column properties

Forms

  1. <form>: Interactive form
  2. <input>: Input field (text, checkbox, radio, etc.)
  3. <textarea>: Multi-line text input
  4. <button>: Clickable button
  5. <select>: Drop-down list
  6. <option>: Option in a <select>
  7. <optgroup>: Groups related <option>s
  8. <label>: Label for form elements
  9. <fieldset>: Groups related form elements
  10. <legend>: Caption for <fieldset>
  11. <datalist>: Predefined options for <input>
  12. <output>: Result of a calculation
  13. <progress>: Progress bar
  14. <meter>: Scalar measurement within a range

Interactive Elements

  1. <menu>: Context menu (rarely used)
  2. <template>: Client-side content template
  3. <slot>: Placeholder in a web component
  4. <canvas>: Draw graphics via JavaScript

Other Tags

  1. <div>: Generic block-level container
  2. <span>: Generic inline container
  3. <abbr>: Abbreviation or acronym
  4. <address>: Contact information
  5. <cite>: Title of a work (e.g., book)
  6. <data>: Machine-readable data
  7. <del>: Deleted text
  8. <ins>: Inserted text
  9. <kbd>: Keyboard input
  10. <samp>: Sample output
  11. <var>: Variable
  12. <wbr>: Word break opportunity
  13. <bdi>: Bi-directional isolation
  14. <bdo>: Bi-directional override
  15. <ruby>: Ruby annotations (for East Asian typography)
  16. <rt>: Ruby text
  17. <rp>: Ruby parentheses

Deprecated Tags (Avoid in HTML5)

  • <acronym>, <applet>, <basefont>, <big>, <center>, <dir>, <font>, <frame>, <frameset>, <noframes>, <strike>, <tt>