Why does HTML5 use semantic elements?

青灯夜游
Release: 2022-01-11 15:23:04
Original
1298 people have browsed it

html5 uses semantic elements to: 1. Increase the accessibility of the website and help create a better website structure; 2. Facilitate later modification and maintenance; 3. Make it easier for screen readers and other auxiliary tools to The page is scanned to provide a better online experience for people with disabilities; 4. Conducive to search engine optimization.

Why does HTML5 use semantic elements?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

Understanding the meaning of words during communication in any language is crucial. If this were computer communication, it would become even more critical. Therefore, HTML5 provides more semantic elements to understand the code easily.

Thus, semantics defines the meaning of words and phrases, i.e.

Semantic elements = elements that have meaning. Semantic elements have simple and clear meanings for both browsers and developers.

For example:

In HTML4, we see that

, , etc. are non-semantic elements. They didn't reveal anything.

On the other hand,

,
etc. are semantic elements because they clearly define their content.

HTML5 semantic elements are supported by all major browsers.

Why use semantic elements?

In HTML4, developers must use their own id/class names to style elements: header, top, bottom, footer, menu, navigation, main content, container , content, articles, sidebar, topnav, etc.

It is very difficult for search engines to identify the correct web page content. This will be easier now in HTML5 elements (

and