Bytes
rocket

Free Masterclass on Mar 21

Beginner AI Workshop: Build an AI Agent & Start Your AI Career

Semantic Tags in HTML

Last Updated: 22nd June, 2023

Introduction

Semantic tags in HTML are special tags that are used to give meaning and context to the content of a webpage. Rather than simply defining the appearance of content, as traditional HTML elements do, semantic tags describe the purpose and function of the content, making it easier for search engines, accessibility tools, and other automated systems to understand the meaning of the content. Using semantic tags in HTML can help improve the accessibility and search engine optimization (SEO) of a webpage, as well as make it easier for other developers to understand and modify the structure of the webpage. Examples of semantic tags include <header>, <footer>, <nav>, <article>, <section>, <aside>, <main>, and <figure>.

<header>

The <header> tag is used to define the header section of a web page or a section of a page. This tag is typically used to include introductory information about the website, such as the website logo, website title, and main navigation. It is recommended to use the <header> tag at the top of every web page to create a consistent structure. For example, the following code snippet shows how the <header> tag can be used to create a website header:

website logo

My Website

<nav>

The <nav> tag is used to define the navigation section of a web page. This tag is typically used to contain a set of links to different pages or sections of the website. For example, the following code snippet shows how the <nav> tag can be used to create a website navigation:



<main>

The <main> tag is used to define the main content section of a web page. This tag should only be used once per page and should contain all of the main content of the page. For example, the following code snippet shows how the <main> tag can be used to create a website main content section:

Welcome to my website!

This is the main content of my website.

<article>

The <article> tag is used to define a self-contained piece of content that could potentially be distributed or reused independently from the rest of the page. For example, a blog post or news article would typically be wrapped in an <article> tag. For example, the following code snippet shows how the <article> tag can be used to create a website article:

My Blog Post

This is my blog post content.

<section>

The <section> tag is used to define a section of a web page that is thematically related. This tag is used to group related content together. For example, the following code snippet shows how the <section> tag can be used to create a website section:

Section Title

This is the content of my section.

<aside>

The <aside> tag is used to define a section of a web page that is related to the main content, but not necessarily part of it. This tag is typically used for sidebars or callout boxes that contain additional information or links related to the main content. For example, the following code snippet shows how the <aside> tag can be used to create a website aside section:


<footer>

The <footer> tag is used to define the footer section of a web page. This tag is typically used to include copyright information, legal disclaimers, or contact information. For example, the following code snippet shows how the <footer> tag can be used to create a website footer:

© 2023 My Website. All rights reserved.

Conclusion

In conclusion, semantic tags in HTML are a powerful tool for web developers to make their websites more accessible, understandable, and SEO-friendly. By using semantic tags such as <header>, <nav>, <main>, <article>, <section>, <aside>, and <footer>, developers can clearly define the structure and purpose of different sections of a webpage. This makes it easier for search engines, accessibility tools, and other automated systems to understand and interpret the content, as well as for other developers to modify and maintain the website. By incorporating semantic tags into their HTML code, developers can create websites that are more effective and user-friendly.

Module 4: Advanced HTML5 TagsSemantic Tags in HTML

Top Tutorials

Logo
Web Development

Javascript

JavaScript Fundamentals is a beginner-level course that covers the basics of the JavaScript programming language. It covers topics on basic syntax, variables, data types and various operators in JavaScript. It also includes quiz challenges to test your skills.

8 Modules37 Lessons10818 Learners
Start Learning
Logo
Web Development

NodeJS

In this comprehensive Node JS tutorial, the fundamentals are thoroughly covered, preparing learners to create scalable and high-performance web applications. The development environment setup, module usage, asynchronous programming implementation, and integration with databases and external services are all explored. By harnessing the capabilities of server-side JavaScript, web development proficiency can be significantly enhanced.

7 Modules27 Lessons8053 Learners
Start Learning
Logo
Web Development

React Fundamentals

Learn React with the best React JS tutorial and master how to build dynamic, user-friendly web applications using the powerful JavaScript library. Start today!

7 Modules25 Lessons16077 Learners
Start Learning
  • Official Address
  • 4th floor, 133/2, Janardhan Towers, Residency Road, Bengaluru, Karnataka, 560025
  • Communication Address
  • Follow Us
  • facebookinstagramlinkedintwitteryoutubetelegram

© 2026 AlmaBetter