</> Code Corner

HTML · HTML Tutorial · Lesson 32

HTML Semantics

Elements that describe their meaning.

A semantic element clearly describes its meaning to both the browser and the developer. <div> and <span> are non-semantic; <form>, <table> and <article> are semantic.

Element Meaning
<article> Independent, self-contained content
<section> A thematic grouping of content
<header> / <footer> Introductory / closing content
<nav> Major navigation links
<main> The main content of the document
<figure> / <figcaption> Self-contained media and its caption
<time> A date or time
<details> / <summary> Expandable details

Example

<article>
  <header><h2>Google Chrome</h2></header>
  <p>Google Chrome is a web browser developed by Google, released in 2008.</p>
  <footer>Posted <time datetime="2008-09-02">Sep 2, 2008</time></footer>
</article>
<figure>
  <img src="https://picsum.photos/id/1040/300/150" alt="Castle">
  <figcaption>Fig.1 - A castle.</figcaption>
</figure>
<details><summary>Click for more</summary><p>Hidden details!</p></details>

Keep reading “HTML Semantics”

Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.

Chat with us 👋