HTML Semantic Elements

Semantic elements in HTML provide meaning and structure to the content. They enhance the accessibility and search engine optimization (SEO) of a webpage by clearly defining different sections and their roles within the document.

Tutorials dojo strip

HTML Semantic Elements Syntax

Common Semantic Elements:

  • <header>: Defines the header section of the document or a section.
  • <nav>: Represents a section of navigation links.
  • <article>: Defines a self-contained piece of content, like a news article.
  • <aside>: Contains content that is related to the main content but not essential.
  • <footer>: Marks the footer of the document or section.
HTML




HTML Semantic Elements Example Code

Explanation of Code:

  • In this example, we utilize various semantic elements to create a structured webpage. The <header> contains a title and introductory text, providing context for the page.
  • The <nav> section includes a list of links, guiding users through the site.
  • The <article> tag contains the main content of the page, making it clear where the primary information is located.
  • The <aside> provides additional information that complements the article but isn’t critical to its understanding.
  • Finally, the <footer> wraps up the page with copyright details, indicating ownership.
HTML




HTML Labs

Tutorials dojo strip