Code has been added to clipboard!

HTML5 Semantic Tags: What Is Semantic Markup?

Reading time 4 min
Published Jun 22, 2017
Updated Jan 21, 2020

TL;DR – HTML5 semantic tags define the function and the category of your text, simplifying the work for browsers and search engines, as well as developers.

The Origins of HTML5 Semantic Tags

HTML5 Semantic Tags
In earlier versions of HTML, there were no globally accepted names for structural elements, and each developer used their own. That made it very hard for search engines to index web page content correctly.

When a browser communicates with the code, it looks for some specific information to help with the display. Hence, HTML5 introduced a consistent list of semantic elements to help search engines and developers.

HTML5 semantic tags define the purpose of the element. By using semantic markup, you help the browser understand the meaning of the content instead of just displaying it. By providing this extra level of clarity, HTML5 semantic elements also help search engines to read the page and find the required information faster.

Semantic Markup for Document Structure

First, we will discuss the HTML5 elements you can see in the illustration above. They are used to convey the structure of the document in a clear manner.

The <header> element defines a header of your document. It is always visible for the users at the top of the page:

 <h3>What is JavaScript?</h3>
 <p>Today we are going to talk about JavaScript</p>

<nav> depicts the space for navigation links on your website:

    <li><a href="">Gamified Courses</a></li>
    <li><a href="">Tutorials</a></li>
    <li><a href="">Space doggo courses</a></li>
    <li><a href="">Game Dev Courses</a></li>

The <section> tags are used to define a separate section within a webpage, with its own content:

  <h1>Section Heading</h1>
  <p>The section tag can contain any elements.</p>
  <img src="image.png" alt="section example">

The <article> element can be used to define the article content on your website:

  <h1>Fun Fact</h1>
  <p>Fun fact: most of the fun facts on the Internet are not actually fun.</p>

The <aside> semantic element defines the content which will be set to the side. It is occasionally used for creating sidebars, but can also be used for displaying less important content:

  <p>Oxford lake is a lake in the state.</p>

The HTML5 <footer> element describes the footnote for your website or part of the content:

    Postal Address: Door No.00, Street, City, State, Country.
  <p>Copyright © 2018 All rights reserved.</p>

Other Commonly Used Semantic Tags

The <figure> element depicts space for separated content, such as photos, diagrams, etc. To provide a caption for this element, use the <figcaption> tags:

  <img src="image.png" alt="The Bread Dog" width="300" height="300">

The <details> element defines the details on your website that can either be visible or hidden. To add a summary for this element, use the <summary> element:

   <summary>Some details</summary> 
   <p>Provide more info about the details here.</p>

The content of the <main> tags is the main content of a page. It can be an article, regular paragraph or anything else:

<main id="content" class="group" role="main">

The <mark> element highlights the text to emphasize its meaning:

<p>The mark tag is <mark>useful</mark> when you need to highlight important information</p>

The <time> element is used to define and display time and date on your web page:

<h2>The premiere show starts at <time>21:00</time> today.</h2>

The <img> tags are used to add an image on your website:

<img src="image.png" alt="Space Doggo" width="50" height="50">

The <form> element allows you to include user input:

<form action="search" method="GET">
  Search Term: <input type="text" name="search_query">
  <input type="submit" value="Search">

The <table> tags are used to add a table with rows and columns on a web page:


HTML5 Semantic Tags: Useful Tips

  • Semantic HTML is also important for accessibility, especially as the number of smart devices keeps growing. It simplifies page navigation for assistive technologies as well.
  • HTML5 elements that help you deal with foreign alphabets are also called semantic – e.g., take a look at <bdi> and <ruby> tags.
  • Using HTML5 semantic tags also makes it easier to create consistent styling with CSS, as you can easily select all similar elements.

Latest Coupon Found:



Learn the skills of tomorrow

The best time to learn programming is now - follow this link to access 100+ coding courses and enjoy learning at a very low cost!

Expiration date: 13/05/2021
2287 People Used
Only 92 Left