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
Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?Mar 04, 2025 pm 12:32 PM

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

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 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.

How to efficiently add stroke effects to PNG images on web pages?How to efficiently add stroke effects to PNG images on web pages?Mar 04, 2025 pm 02:39 PM

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

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

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

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

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

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

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!