Chuck's Academy

Basic HTML

Semantic HTML

Introduction to Semantic Elements

Semantic HTML refers to the use of tags that clearly describe the purpose of the elements in a web page. This helps search engines and assistive devices better understand the structure and content of the page, improving accessibility and search engine optimization.

Sections and Articles (<header>, <footer>, <section>, <article>)

Some of the most common semantic tags are <header> and <footer> for headers and footers, <section> to group content thematically, and <article> for standalone content.

html
"In this example, the article tag contains the content of a complete article. Within it, the header contains the title and date, the section contains the content, and the footer provides information about the author."

Aside, Nav, and Main Elements (<aside>, <nav>, <main>)

Other important tags include <aside> for related content, <nav> for navigation, and <main> for the main content of the page. These tags enhance the organization and navigation of the site.

html
"Here we use three semantic tags: main for the main content, aside for complementary information, and nav to create a navigation menu for the page."

Accessibility with Semantic HTML

The use of semantic HTML contributes to accessibility, allowing assistive devices, such as screen readers, to interpret and navigate the content efficiently. This also benefits users with disabilities, as semantic elements make the page structure clearer.

For example, a screen reader identifies the <nav> tag as a navigation area, allowing the user to jump directly to the menu instead of reading all the content.

Chapter Closure

You now understand how semantic elements can improve the accessibility and organization of your web pages. In the next chapter, we will learn about HTML5 APIs and other advanced elements that enrich content functionality.


Ask me anything