Course Content
About Lesson

Here are some commonly used semantic HTML tags and their purposes:

Represents the header of a webpage or a section, often containing the logo, navigation, or introductory content.

Example:

HTML
<header> 
 <h1>My Website</h1> 
 <nav> 
  <a href="#home">Home</a> 
  <a href="#about">About</a> 
  <a href="#contact">Contact</a>
 </nav> 
</header>

Contains the navigation links for the website.

Example:

HTML
<nav> 
 <a href="#home">Home</a> 
 <a href="#services">Services</a> 
 <a href="#contact">Contact</a> 
</nav>

Holds the main content of the document that is unique to the page. This is particularly useful for accessibility, as it allows screen readers to skip directly to the main content.

Example:

HTML
<main> 
 <h2>Welcome to Our Services</h2> 
 <p>We offer a range of services to meet your needs.</p> 
</main>

Represents a self-contained piece of content like a blog post, news article, or forum entry.

Example:

HTML
<article> 
 <h2>Understanding HTML Semantics</h2> 
 <p>This article explains the importance of HTML semantics...</p> 
</article>

Defines a thematic grouping of content, like a chapter in a book or a section within a website.

Example:

HTML
<section> 
 <h2>Our Services</h2> 
 <p>We provide web development, SEO, and digital marketing services.</p> 
</section>

Holds content related to the main content, like a sidebar, ads, or additional resources.

Example:

HTML
<aside> 
 <h3>Related Articles</h3> 
 <ul> 
  <li><a href="#html">HTML Basics</a></li> 
  <li><a href="#css">CSS Styling Tips</a></li> 
 </ul> 
</aside>

Represents the footer of a document or a section, often containing contact information, copyright info, or links.

Example:

HTML
<footer> 
 <p>© 2024 My Website. All Rights Reserved.</p>
</footer>
  • <figure> is used to group media elements (like images, videos) along with their captions, if needed.
  • <figcaption> provides a caption or explanation for the content within the <figure>.

Example:

HTML
<figure> 
 <img src="image.jpg" alt="Sample image"> 
 <figcaption>A descriptive caption for the image.</figcaption> 
</figure>

Represents a specific time or date, which can be useful for events or blog post dates.

Example:

HTML
<p>Published on 
 <time datetime="2024-11-08">November 8, 2024</time>
</p>