search
HomeWeb Front-endHTML TutorialTalking about the semantics of HTML tags in CSS layout_html/css_WEB-ITnose

Many people are doing front-end work, including many novices here. Maybe the newbies’ idea is not to use font tags and the like when doing layout, even if it is a web standard. In this way, As a result, there is a "flooding of divs" on the Internet today. When I look at the source file, Huo, there are no other tags except div.

Here, I can tell you responsibly that this is not called a web standard, this is called "div css". A veritable "div css".
Some people may say that the page I made using "div css" fully expresses the intention of the design drawing, and is compatible with all browsers without any problems.
Indeed, the page you created looks like there is no problem. Note, it says “it looks like there is no problem”, that’s all.


Humans can judge the semantics of content through visual division, but search engines only see code. Search engines can only judge the semantics of content through tags.

So why should we pay attention to semantics? Because a large part of the traffic of the page comes from search engines. To make the page as search engine friendly as possible, we must make the tags as semantic as possible change.

The div tag only plays a role in dividing content for search engines, and does not tell the browser what the content in this tag is used for. Therefore, if the entire page is only laid out with divs, then this page is not as important as a sentence to the search engine, because the search engine does not know what the focus of your page is, what the list is, what the content is, etc.

All tags have semantics. Let’s take a look at the semantics of some tags:

div Semantics: Division (separation)
span Semantics: Span (range)
ol Semantics: Ordered List (sorted list)
ul Semantics: Unordered List (unordered list)
li Semantics: List Item (list item)
p Semantics: paragraph marks (paragraph mark)
hx Semantics :headword (title)
…………

If you ignore tag semantics and default styles and use divs for all tags, you can actually write pages with good visual effects, as long as you use CSS flexibly. But in that case, although the visual requirements are met, the entire page has no semantic meaning at all, and search engines still cannot understand it. Therefore, remember:

The structure (html) is the key, and the style (css) is used to modify the structure. Therefore, you must first determine the html and tags, and then choose the appropriate css.

Generally speaking, all tags will have a default style, so a simple way to judge whether the semantics of web page tags is good is to remove the style and see if the web page structure is well organized and orderly. Still very readable.

In addition, it is worth mentioning the h tag. The semantic meaning of the h tag is the title. Search engines are more sensitive to this tag, especially h1 and h2. For a page with good semantics, h tags should be complete and orderly without gaps. In other words, h1, h2, h3, h4 should be pushed down like this, instead of h1, h3, h4, and h2 should be missed. For a well-structured web page, the h tag can organize the outline of the web page. Deepen your understanding of html.

Although HTML is very simple, it is not easy to use it well. The more you study it, the more interesting it will be.

This article is reproduced from ZeroZ

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use