Course Content
HTML Forms
HTML forms are an essential part of web development and provide a way for users to input and submit data to a server. Forms allow users to enter data such as text, numbers, checkboxes, radio buttons, and more. When a user submits a form, the data is typically sent to a server for further processing.
0/6
HTML Graphics
HTML provides various ways to incorporate graphics into web pages.
0/2
HTML Media
HTML provides built-in support for embedding and displaying various types of media content on web pages.
0/5
HTML APIs
HTML APIs, also known as browser APIs or web APIs, are a set of interfaces and methods provided by web browsers to interact with and manipulate web content, access device features, and perform various tasks. These APIs are implemented in JavaScript and are accessible to web developers when creating web applications. Here are some commonly used HTML APIs:
0/5
HTML Examples
Creating a Simple Web Page, Adding Links and Images and more
0/4
HTML5 for Free | HTML5 – Unleashing the Potential of Web Development
About Lesson

Certainly! Here are some examples of HTML semantic elements along with their usage:

  1. <header>:
   <header>
     <h1>My Website</h1>
     <nav>
       <ul>
         <li><a href="/">Home</a></li>
         <li><a href="/about">About</a></li>
         <li><a href="/contact">Contact</a></li>
       </ul>
     </nav>
   </header>

In this example, the <header> element contains the website’s title and a navigation menu.

  1. <nav>:
   <nav>
     <ul>
       <li><a href="/">Home</a></li>
       <li><a href="/about">About</a></li>
       <li><a href="/contact">Contact</a></li>
     </ul>
   </nav>

The <nav> element represents a section that contains navigation links.

  1. <main>:
   <main>
     <h1>Welcome to My Website!</h1>
     <p>This is the main content of the webpage.</p>
   </main>

The <main> element represents the main content of a webpage.

  1. <article>:
   <article>
     <h2>Blog Post Title</h2>
     <p>Content of the blog post...</p>
     <p>More content...</p>
   </article>

The <article> element represents a self-contained composition, such as a blog post.

Use CSS to style the element:

<html>
<head>
<style>
.all-browsers {
  margin: 0;
  padding: 5px;
  background-color: lightgray;
}

.all-browsers > h1, .browser {
  margin: 10px;
  padding: 5px;
}

.browser {
  background: white;
}

.browser > h2, p {
  margin: 4px;
  font-size: 90%;
}
</style>
</head>
<body>

<article class="all-browsers">
  <h1>Most Popular Browsers</h1>
  <article class="browser">
    <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 class="browser">
    <h2>Mozilla Firefox</h2>
    <p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.</p>
  </article>
  <article class="browser">
    <h2>Microsoft Edge</h2>
    <p>Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.</p>
  </article>
</article>

</body>
</html>
  1. <section>:
   <section>
     <h2>About Us</h2>
     <p>Information about the company...</p>
   </section>

The <section> element represents a generic section of content within a document.

  1. <aside>:
   <aside>
     <h3>Related Links</h3>
     <ul>
       <li><a href="/blog">Blog</a></li>
       <li><a href="/resources">Resources</a></li>
     </ul>
   </aside>

The <aside> element represents content that is tangentially related to the main content.

  1. <footer>:
   <footer>
     <p>© 2023 My Website. All rights reserved.</p>
   </footer>

The <footer> element represents the footer or closing content of a webpage.

These examples demonstrate how semantic elements can be used to structure and describe different parts of a webpage, making it more meaningful and accessible. By using these elements appropriately, you can enhance the readability, structure, and semantics of your HTML code.

Join the conversation