Semantic HTML — Why it is important?

Abhishek Gangwar
3 min readApr 30, 2024
Photo by Jackson Sophat on Unsplash

What is Semantic HTML?

Semantic HTML, also known as semantic markup, refers to HTML code that uses tags to indicate the purpose of page elements. This helps visitors understand the structure of the content, such as paragraphs, and how it should be displayed on a web page.

Semantic markup aids readers, search engines, browsers, and assistive technologies in interpreting the elements of a web page.

Why Semantic HTML is important?

Semantic HTML offers several key features:

  • Accessibility: Semantic HTML tags make web page elements easier to understand and improve navigation. These tags help readers grasp the purpose of the content and how users can interact with it. In short, semantic tags enhance user navigation and present the content more effectively.
  • SEO (Search Engine Optimization): Semantic markup or semantic HTML tags benefit search engines. By using these tags, web pages can present elements in a way that search engines can easily understand, improving the site’s ranking based on efficient navigation by search engine crawlers.
  • Human Readability: Semantic tags improve the human readability of web page elements. Developers can quickly locate specific page elements and make necessary changes or enhancements. Readability is crucial for enhancing user experience (UX), achieving a better ranking, and enabling developers to make improvements.
  • Improved Interoperability: Semantic HTML ensures that content is correctly interpreted by different browsers, devices, and platforms, leading to a more consistent user experience.
  • Future-proofing: As the web evolves, semantic HTML is more likely to be compatible with new technologies and standards, safeguarding against potential changes.

Semantic HTML Tags Structure

Here’s the list of some popular Semantic elements added in HTML5:

  • <header>: This tag defines the header of a document or a specific section within a document. It is typically used for introductory content, such as a title or a logo.
  • <nav>: This tag is used to define a section of navigation links within a document.
  • <main>: This tag specifies the main content of a document. There should be only one <main> tag per document, and it contains the central and most important information.
  • <section>: This tag groups related content together. It's a way to create logical divisions within the document, such as chapters or sections of an article.
  • <article>: This tag defines an independent, self-contained piece of content. An <article> can include text, images, and other multimedia elements and should be reusable and shareable.
  • <aside>: This tag contains content that is tangentially related to the surrounding content. It is often used for sidebars or other supplementary information.
  • <footer>: This tag defines the footer of a document, usually including information such as copyright notices, contact information, or links to additional resources.
  • <figure>: This tag groups multimedia content (such as images, videos, or charts) with a caption for better context and description.
  • <figcaption>: This tag provides a caption or description for multimedia content grouped within a <figure> element.
  • <time>: This tag defines a date or time value, which can be presented in a standardized format for consistency and compatibility with assistive technologies.
  • <details>: Represents additional information that can be toggled open or closed by the user.
  • <mark>: Represents highlighted text.
  • <progress>: Represents a progress bar for a task that is in progress.

Summing it Up

When writing HTML, using semantic tags is important because it improves the accessibility and searchability of your content, as well as making the code more understandable and maintainable.

By using tags that convey the purpose of different sections of a webpage, you enhance the experience for both users and developers.

--

--