When they first came into contact with XHTML+CSS to design web pages, many of my friends had little experience in using tags and were very casual. They often used whatever came to mind, thinking that as long as it can achieve the effect, it would be enough. But with the deepening of study and understanding of search engine optimization knowledge, I found that the use of XHTML tags is actually a knowledge.
The following introduces the correct use of some XHTML tags that are commonly used by beginners and are easy to confuse their usage. Welcome to follow Taoba, the website, and welcome to discuss. I will not give a detailed introduction to the corresponding attributes and usage of each tag in CSS here. I will focus on the application in web pages. I hope it can be helpful to everyone.
1. DIV
DIV should be familiar to friends who build XHTML websites. Many websites and materials also call Web standard website construction DIV+CSS website construction. It is not unreasonable to call it this way, because W3C does not recommend that the Table tag be used in the layout of web pages, and DIV as a layout tag naturally assumes the important responsibility of layout.
DIV can also be said to be a large container. In addition to the overall structural layout of the web page, it is recommended to be used to divide areas that appear to be relatively independent in the web page. Just like a newspaper, the function of DIV is a large container for dividing different content. In different areas, appropriate labels are selected according to specific situations.
2. H tag
The H tag is a title tag, often used before a paragraph to indicate the meaning of the paragraph. It can be divided into H1~H6 according to the level of display and meaning to be expressed.
H1 is of the highest importance and is often used to express a description of the role and nature of the entire website, or to indicate the audience for which the website is intended. Other labels are used to display the name of a certain area or a general description of a certain introductory text depending on the level.
Because it represents a general description of the website or a certain paragraph of text, the H tag has a high value relative to search engines. But this does not mean that it can be used casually. For example, some websites use H tags to display keywords in a paragraph of text in order to deliberately pursue rankings for specific keywords. Or simply use the H tag as a container to layout the web page. This completely confuses the role of the H tag and is not recommended.
3.P
P is a paragraph tag, used to distinguish different paragraphs of a set of text. For search engines, according to their crawling order, the text in the first P tag also has high value. Like Baidu, it ignores the text in the Meta tag description (description) and grabs the content in the first P tag (not absolutely).
In order to allow search engines to crawl more content and provide users with a better browsing experience, some websites use segmentation
Label. That’s not to say it’s impossible, sometimes it just doesn’t achieve the desired results. For strictly typed documents,
It is a tag belonging to the expression form and is not allowed to be used.
Although most websites use transitional document types, I do not recommend using them for text segmentation.
4. UL and LI labels
This is an unordered list, the UL tag is the declaration of the list, and LI is the list item. Due to the relative independence of its projects, it is often used in navigation, news or article lists, etc. UL can also be used as a container to distinguish different lists.
Some websites can pursue "Web standards" and convert Tables to UL and LI, which makes web pages difficult to read and maintain. Wrong understanding goes against the concepts conveyed to us by Web standards.
5. Table
I won’t introduce too much about the usage of Table here. I just want to say that the Web standard does not mean that Table cannot be used in the future, but it is not recommended to use Table for layout and should only be used when displaying data. Therefore, there is no contradiction between web pages that comply with the Web and the use of Table tags.
6. Tags prepared for search engines
(1)Title: The title of the web page, a description of the website. Subtags are also valuable to search engines and often include target keywords.
(2)Meta keywords: the main keywords in the web page. It was originally prepared to facilitate search engines to classify websites, but in the later period, many websites often used this tag to cheat in order to make keyword rankings more favorable, so now this tag has almost no meaning for search engines.
(3) Meta's Description: a description of the web page. Like Keywords, it was originally intended to facilitate search engine classification. It is also because many websites use this tag to cheat, so it is no longer so important to search engines. Currently, among the mainstream search engines, only Google still crawls the content, but it hardly determines keywords based on the content.
In fact, for search engines, the most important thing is the quality of the content. Similarly, we build websites to promote ourselves to visitors. Please don’t forget the fundamentals because of the quickness. After all, users care about whether the information is what they need, not the ranking of your website.
-