Home > Web Front-end > HTML Tutorial > Talking about the semantics of HTML tags in CSS layout_html/css_WEB-ITnose

Talking about the semantics of HTML tags in CSS layout_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:46:35
Original
1086 people have browsed it

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template