Home  >  Article  >  Web Front-end  >  Introduction to XHTML tag semantics_HTML/Xhtml_Web page production

Introduction to XHTML tag semantics_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:41:331537browse

The first point to explain is that people can judge the semantics of content through visual division, and search engines only see code. Search engines can only judge the semantics of content through tags. I really didn’t pay much attention to search engines before, but now I start to pay more attention to it, because a large part of the traffic of the page comes from search engines. To make the page as friendly as possible to search engines, it is necessary to make the tags semantic as much as possible. change.

In the past, based on my superficial understanding of web development, I thought that to write a good standard-compliant page, you only need to separate the structure and presentation, and then don’t use table, font and other tags. As for the entire page, it is div. I don't think there is any problem because CSS is very powerful. However, all tags have their own semantics. The semantics of some tags are given below:

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)

… ………

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 semantics at all, and search engines still cannot understand it. Therefore, remember:

The structure (html) is the focus, 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 whether there is still a lot of content. Good readability.

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.

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