New semantic elements in HTML5 | Writing HTML Markup

HTML5 introduced several new semantic elements that can enhance the structure and readability of your web pages, especially when designing for responsive layouts. These elements provide more meaningful information about the content, which can improve accessibility and SEO.

Key New Semantic Elements

  • <header>: Defines the header section of a page, often containing the logo, navigation menu, and search bar.
  • <nav>: Represents a section of the page that contains navigation links.
  • <main>: Defines the main content of a page.
  • <article>: Represents an independent item of content, such as a blog post or news article.
  • <section>: Defines a thematic grouping of content.
  • <aside>: Defines content that is tangentially related to the main content.
  • <footer>: Defines the footer section of a page, often containing copyright information, contact details, and links to social media.

Benefits of Using Semantic Elements

  • Improved Accessibility: Screen readers and other assistive technologies can better understand the structure and meaning of your content, making it more accessible to users with disabilities.
  • Enhanced SEO: Search engines can better understand the content of your page, potentially improving your search engine rankings. 
  • Better Readability: Semantic elements help to visually organize your content, making it easier for users to understand and navigate.

Example:

<!DOCTYPE html>

<html>

<head>

  <title>My Responsive Website</title>

  <link rel=”stylesheet” href=”styles.css”>

</head>

<body>

  <header>

    <h1>My Website</h1>

    <nav>

      <ul>

        <li><a href=”#”>Home</a></li>

        <li><a href=”#”>About</a></li>

        <li><a href=”#”>Contact</a></li>

      </ul>

    </nav>

  </header>

  <main> 

    <article>

      <h2>My First Blog Post</h2>

      <p>This 

is the content of my blog post.</p>

    </article>

    <aside>

      <h3>Sidebar Content</h3>

      <p>This is some additional content.</p>

    </aside>

  </main>

  <footer>

    <p>&copy; 2023 My Website</p>

  </footer>

</body>

</html>

By using these new semantic elements, you can create more structured and meaningful HTML documents, which can improve the overall user experience and accessibility of your responsive website.

Starting HTML pages correctly | Writing HTML Markup
HTML grouping elements | Writing HTML Markup

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?