HTML Semantic Elements
What are Semantic Elements?
A semantic element clearly describes its meaning to both the browser and the developer.
Examples of semantic elements: <img>, <table>, and <article> - Clearly defines its content.
Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.
HTML Semantic Elements
The following table shows the semantic HTML elements that are used to structure a web page:
| Element | Description |
|---|---|
| <header> | Specifies a header for a document or section |
| <nav> | Defines navigation links |
| <main> | Specifies the main content of a document |
| <article> | Defines independent, self-contained content |
| <section> | Defines a section in a document |
| <aside> | Defines content aside from the page content |
| <details> and <summary> | Defines a summary heading that the user can open to show more details |
| <figure> and <figcaption> | Defines self-contained content (e.g. illustrations, diagrams, photos, etc.) with a caption |
| <footer> | Defines a footer for a document or section |
| <mark> | Defines marked/highlighted text |
| <time> | Defines a date/time |
HTML <header> Element
The <header> element represents a container for introductory content.
If a <header> element is used on the
top of a page, it is like a global site header, and usually contains:
- company name
- logo or icon
- a search feature
- maybe some global navigation
Example
Use <header> as page header:
<header>
<h1>Title of Main Page</h1>
<img
src="logo.png" alt="Your logo" >
</header>
Note: You can have several <header> elements in one
HTML document, but notice that <header> cannot be placed within a <footer>, <address> or another <header> element.
Example
Use <header> as <article> header:
<article>
<header>
<h1>What Does WWF Do?</h1>
<p>WWF's mission:</p>
</header>
<p>WWF's mission is to stop the degradation of our planet's natural environment,
and build a future in which humans live in harmony with nature.</p>
</article>
Try it Yourself »
HTML <nav> Element
The <nav> element defines a set of navigation links,
like menus and table of contents.
Notice that not all links in a document should be inside a <nav> element. The
<nav> element is intended for major blocks of navigation links.
Screen readers can use this element to determine whether to omit the initial rendering of this content.
Example
A set of navigation links:
<nav>
<a href="#">HTML</a> |
<a href="#">CSS</a> |
<a href="#">JavaScript</a> |
<a href="#">Python</a> |
<a href="#">SQL</a>
</nav>
Try it Yourself »
HTML <section> Element
The <section> element defines a section in a document.
A section is a thematic grouping of content, and typically start with a heading.
Examples of where a <section> element can be used:
- Chapters
- Introduction
- News items
- Contact information
A web page could normally be split into sections for introduction, content, and contact information.
Example
Two sections in a document:
<section>
<h1>WWF</h1>
<p>The World Wide Fund for Nature (WWF) is an
international organization working on issues regarding the conservation,
research and restoration of the environment, formerly named the World
Wildlife Fund. WWF was founded in 1961.</p>
</section>
<section>
<h1>WWF's Panda symbol</h1>
<p>The Panda has become the symbol of WWF.
The well-known panda logo of WWF originated from a panda named Chi Chi that
was transferred from the Beijing Zoo to the London Zoo in the same year of
the establishment of WWF.</p>
</section>
Try it Yourself »
HTML <article> Element
The <article> element specifies independent, self-contained content.
An article should make sense on its own, and it should be possible to distribute it independently from the rest of the web site.
Examples of where the <article> element can be used:
- Forum posts
- Blog posts
- User comments
- Product cards
- Newspaper articles
Example
Three articles with independent, self-contained content:
<article>
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser
developed by Google, released in 2008. Chrome is the world's most popular
web browser today!</p>
</article>
<article>
<h2>Safari</h2>
<p>Safari is an open-source web browser developed by
Apple, released in 2003. Safari is the second most popular web browser
today.</p>
</article>
<article>
<h2>Microsoft Edge</h2>
<p>Microsoft Edge is a web browser developed by Microsoft, released in 2015.
Microsoft Edge replaced Internet Explorer.</p>
</article>
Try it Yourself »
Example 2
Use CSS to style the <article> element:
<style>
article.all-browsers {
margin: 0;
padding: 5px;
background-color: lightgray;
}
article.all-browsers
h1, article.browser {
margin: 10px;
padding: 5px;
}
article.browser {
background: white;
}
article.browser h2,
p {
margin: 5px;
}
</style>
Try it Yourself »
Nesting <article> in <section> or Vice Versa?
The <article>
element specifies independent, self-contained content.
The <section> element defines a section in a document.
Can we use the definitions to decide how to nest those elements? No, we cannot!
So, you will find HTML pages with <section> elements
containing <article> elements, and <article> elements containing <section> elements.
HTML <footer> Element
The <footer> element defines a footer for a document or section.
A <footer> element typically contains:
- authorship information
- copyright information
- contact information
- related documents
Example
A footer section in a document:
<footer>
<p>© 2026 W3Schools. All Rights Reserved.</p>
</footer>
Try it Yourself »
HTML <aside> Element
The <aside> element defines some content aside from the content it is
placed in (like a sidebar).
The <aside> content should be
indirectly related to the surrounding content.
Example
Display some content aside from the content it is placed in:
<p>My family and I visited The Epcot center this summer. The weather was
nice, and Epcot was amazing! I had a great summer together with my
family!</p>
<aside>
<h4>Epcot Center</h4>
<p>Epcot is a theme
park at Walt Disney World Resort featuring exciting attractions,
international pavilions, award-winning fireworks and seasonal special
events.</p>
</aside>
Try it Yourself »
Example 2
Use CSS to style the <aside> element:
<style>
aside {
width: 30%;
paddingt: 10px;
margin: 5px 10px;
float: right;
font-style: italic;
border: 1px solid green;
border-radius: 5px;
}
</style>
Try it Yourself »
HTML <figure> and <figcaption> Elements
The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
The <figcaption> tag defines a caption for a <figure> element. The <figcaption> element can be placed as the first or
as the last child of a <figure> element.
The <img> element defines the actual image/illustration.
Example
<figure>
<img src="pic_trulli.jpg" alt="Trulli">
<figcaption>Fig1. - Trulli, Puglia, Italy.</figcaption>
</figure>
Try it Yourself »
HTML <details> and <summary> Elements
The <details> tag specifies additional details that the user can open and close on demand.
The <summary> tag defines a visible
heading for the <details> element. The
heading can be clicked to open/hide the details.
Example
<details>
<summary>Epcot Center</summary>
<p>Epcot is a theme park at
Walt Disney World Resort featuring exciting attractions, international
pavilions, award-winning fireworks and seasonal special events.</p>
</details>
Try it Yourself »
Why use Semantic HTML Elements?
Semantic HTML helps in three main ways:
- Accessability - Screen readers and other helper-tools use semantic tags to find their way around the page. This makes your page easier to use for people who cannot see the screen
- SEO - Search engines understand well-organized pages better. The right tags can help your page show up in search results
- Easier to work with - Clear structure makes your code easier to read, fix, and change, especially in big projects
Semantic Elements in HTML
Below is a list of some of the semantic elements in HTML.
| Tag | Description |
|---|---|
| <article> | Defines independent, self-contained content |
| <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> | Specifies the main content of a document |
| <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 |
For a complete list of all available HTML tags, visit our HTML Tag Reference.