HTML Semantics - Javatpoint
HTML Semantics - Javatpoint
https://www.javatpoint.com/html5-semantics 1/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
HTML5 Semantics
In any language, it is essential to understand the meaning of words during communication. And if
this is a computer communication then it becomes more critical. So HTML5 provides more semantic
elements which make easy understanding of the code.
Semantic elements= elements with a meaning. Semantic elements have a simple and clear meaning
for both, the browser and the developer.
For example:
In HTML4 we have seen <div>, <span> etc. are which are non-semantic elements. They don't tell
anything about its content.
On the other hand, <form>, <table>, and <article> etc. are semantic elements because they clearly
define their content.
This is so difficult for search engines to identify the correct web page content. Now in HTML5
elements (<header> <footer> <nav> <section> <article>), this will become easier. It now allows
data to be shared and reused across applications, enterprises, and communities."
Semantic elements can increase the accessibility of your website, and also helps to create a better
website structure.
https://www.javatpoint.com/html5-semantics 2/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
3. <details> Defines additional details that the user can view or hide
HTML <article> element defines article content within a document, page, application, or a website.
It can be used to represent a forum post, a magazine, a newspaper article, or a big story.
Example:
<article>
<h2>Today's highlights</h2>
<p>First story</p>
<p>Second story</p>
<p>Third story</p>
</article>
Test it Now
https://www.javatpoint.com/html5-semantics 3/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
The <aside> element represent the content which is indirectly giving information to the main
content of the page. It is frequently represented as a sidebar.
Example:
<body>
<h2>My last year memories</h2>
<p>I have visited Paris with my friends last month. This was the memorable journey and i wish to g
</p>
<aside>
<h4>Paris</h4>
<p>Paris, France's capital, is a major European city and a global center for art, fashion, gastronom
</aside>
</body>
Test it Now
The <section> element is used to represent the standalone section within an HTML document. A
page can have various sections and each section can contain any content, but headings for each
section is not mandatory.
Example:
Test it Now
https://www.javatpoint.com/html5-semantics 4/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
AD
In HTML, we can use <section> elements within <article> elements, and <article> elements within
<section> elements.
We can also use <section> elements within <section> elements, and <article> elements within
<article> elements.
For example:
In a newspaper, the sport <article> in the sport section, may have a technical section in each
<article>.
Example:
<!DOCTYPE html>
<html>
<body>
<nav>
<a href="https://www.javatpoint.com/html-tutorial">HTML</a> |
<a href="https://www.javatpoint.com/java-tutorial">Java</a> |
<a href="https://www.javatpoint.com/php-tutorial">PHP</a> |
<a href="https://www.javatpoint.com/css-tutorial">CSS</a>
</nav>
</body>
</html>
https://www.javatpoint.com/html5-semantics 5/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
Test it Now
The <header> element represent the header of the document which can contain introductory
content or navigation links.
Example:
<header>
<h1>Welcome to Web123.com</h1>
<nav>
<ul>
<li>Home |</li>
<li>About us |</li>
<li>Contact us</li>
</ul>
</nav>
</header>
Test it Now
Example:
<footer>
<p>© Copyright 2019. All rights reserved. </p>
</footer>
Test it Now
← Prev Next →
https://www.javatpoint.com/html5-semantics 6/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
AD
Feedback
https://www.javatpoint.com/html5-semantics 7/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
Keras tutorial
Keras
Preparation
Company
Interview
Questions
Company Questions
Trending Technologies
https://www.javatpoint.com/html5-semantics 8/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
B.Tech / MCA
https://www.javatpoint.com/html5-semantics 9/10
2/5/24, 9:29 PM HTML Semantics - javatpoint
AD
https://www.javatpoint.com/html5-semantics 10/10