HTML5 Semantics Elements


semantic element clearly describes its meaning to both the browser and the developer.Hence Semantics defines the meaning of words and phrases,

Semantic elements= elements with a meaning.


Semantic elements Examples

In HTML4 we have seen <div>, <span> etc. are which are non-semantic elements. They don't tell anything about its content.

But <form>, <table>, and <article> are semantic elements because they clearly define their content.

HTML5 semantic elements are supported by all major browsers.


Features of semantic elements

  • Many web sites contain HTML code like: <div id="nav"> <div class="header"> <div id="footer"> to indicate navigation, header, and footer.This is so difficult for search engines to identify the correct web page content. Now in HTML5 semantic elements this will become easier.
  • Semantic elements can increase the accessibility of your website, and also helps to create a better website structure.
Tags Works for
<article> Defines an article
<aside> Defines content aside from the page content
<details> Defines additional details that the user can view or hide
<figcaption> Defines a caption for a <figure> element
<figure> Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
<footer> Defines a footer for a document or section
<header> Specifies a header for a document or section
<main> Defines marked/highlighted text
<mark> Defines marked/highlighted text
<nav> Defines navigation links
<section> Defines a section in a document
<summary> Defines a visible heading for a <details> element
<time> Defines a date/time