Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære What is Semantic HTML? | Understanding Semantic HTML
Build Meaningful and Accessible Web Pages

bookWhat is Semantic HTML?

Semantic HTML refers to using HTML elements that communicate the meaning and structure of your content, rather than just its appearance. The purpose of semantic HTML is to make your web pages more understandable for both browsers and humans, including assistive technologies like screen readers. Semantic elements, such as header, nav, main, article, section, and footer, describe their intended role in the document. This helps search engines and accessibility tools interpret your content accurately.

In contrast, non-semantic elements like div and span do not provide any information about the type of content they contain—they are generic containers used primarily for styling or grouping content.

Using semantic elements improves code readability, maintainability, and accessibility. For example:

  • A nav element clearly indicates that its content is a navigation menu;
  • A div does not provide this context.

This distinction is especially important for users who rely on screen readers or other assistive devices, as semantic markup enables those tools to present the page structure and meaning more effectively.

non-semantic.html

non-semantic.html

semantic.html

semantic.html

copy

1. Which of the following elements are considered semantic HTML elements? Select all that apply.

2. When should you use a div instead of a semantic element?

question mark

Which of the following elements are considered semantic HTML elements? Select all that apply.

Select the correct answer

question mark

When should you use a div instead of a semantic element?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 1

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Awesome!

Completion rate improved to 8.33

bookWhat is Semantic HTML?

Stryg for at vise menuen

Semantic HTML refers to using HTML elements that communicate the meaning and structure of your content, rather than just its appearance. The purpose of semantic HTML is to make your web pages more understandable for both browsers and humans, including assistive technologies like screen readers. Semantic elements, such as header, nav, main, article, section, and footer, describe their intended role in the document. This helps search engines and accessibility tools interpret your content accurately.

In contrast, non-semantic elements like div and span do not provide any information about the type of content they contain—they are generic containers used primarily for styling or grouping content.

Using semantic elements improves code readability, maintainability, and accessibility. For example:

  • A nav element clearly indicates that its content is a navigation menu;
  • A div does not provide this context.

This distinction is especially important for users who rely on screen readers or other assistive devices, as semantic markup enables those tools to present the page structure and meaning more effectively.

non-semantic.html

non-semantic.html

semantic.html

semantic.html

copy

1. Which of the following elements are considered semantic HTML elements? Select all that apply.

2. When should you use a div instead of a semantic element?

question mark

Which of the following elements are considered semantic HTML elements? Select all that apply.

Select the correct answer

question mark

When should you use a div instead of a semantic element?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 1
some-alt