<br />The most common mistake made by many website designers is that they think their codes are correct when their web pages can be displayed normally under IE. We even often see people complaining about their website's poor ranking. A quick look at their website will reveal that the HTML code is full of various errors. No matter how much effort you put into optimizing the website based on such code, the results may be wasted! In fact, IE is a browser that is highly tolerant of HTML code errors. As an aside, although we can have all kinds of reasons to attack Microsoft, the efforts Microsoft has made in making its products easy to operate and usable cannot be denied. ——The fact that a web page can be displayed normally under IE does not mean that there is no problem with the HTML code of the page. It can even be generalized that the fact that a web page can be displayed normally under multiple browsers does not mean that the HTML code is completely legal and valid. After all, every browser must guarantee basic fault-tolerant functions. Otherwise, the HTML page may not be displayed normally just because of a single point in the network transmission. This still happens frequently today when network bandwidth is still tight. What is legal and valid HTML code ?<br />To put it simply, our web pages are made up of HTML (Hypertext Markup Language) elements. Even for dynamic pages such as ASP and PHP, the SERVER renders the ASP or PHP statements into corresponding HTML elements and transmits them to the client; for JavaScript and the like, the client converts them into HTML. Like other languages, HTML also has its own grammatical rules. Both browsers and search engine spiders analyze the content of web page codes based on these rules. But many times, even for skilled people, it is still difficult to avoid making some HTML code errors when building HTML pages, not to mention the HTML redundancy and bloat caused by most WYSIWYG editors. If there is no violation of HTML standard syntax in the page, it can be called legal and valid HTML code. The importance of legal and valid HTML code to SEO <br />In order for search engines to include our web pages - and only on this basis can we talk about website optimization and website promotion - the prerequisite is to allow the search engine's Spider to understand our web files. The basis for search engine Spider to read web pages is HTML specifications. By analyzing the HTML code, Spider can determine the content of the web page, and on this basis can determine the relevance of the corresponding keywords. It should be made clear that one thing that makes search engine spiders different from browsers is that their fault tolerance is much worse than that of browsers. If there is HTML code in the page code that it cannot interpret, it may stop reading the page or even stop crawling on our website. More serious errors may even cause it to discard the content information of other pages on the website that it has already collected. Although nowadays major search engines are also trying their best to improve the fault tolerance of Spider so that it will not affect the collection of content when general errors occur in HTML code. But many times, it still happens that a closing tag is omitted and the content of the entire page is ignored. On the other hand, legal and valid HTML can also ensure that web pages can be correctly interpreted in multiple browsers, avoiding the situation where the same page displays normally in IE but is severely distorted in Mozilla (of course, it cannot be completely avoided). This is also of great benefit in improving the usability of the website. How to verify the validity of HTML code? There are many similar free services on the Internet that can help us verify whether the web page code is legal and valid. The most famous one is W3C HTML Validator, which is a free service project officially launched by W3C (World Wide Web Consortium). On its page, you only need to enter the HTML address to be verified or upload an HTML file on the local machine. It will quickly return the verification result, including whether it is correct, what are the errors if there are any, and how to improve them. At the same time, W3C HTML Validator also provides validation services for CSS files. Is it necessary to pass W3C verification? The answer to this question is less clear-cut. In theory, legal HTML code can make it easier for search engine spiders to collect content information on website pages. But on the other hand, not all HTML code errors will affect Spider's crawling, that is to say, a small number of HTML errors are acceptable to Spider. So, is it necessary to pass W3C certification? On the other hand, as in Mark Daoust's test, it is even implied (without a definite conclusion) that a small number of HTML code errors can give a page an advantage in Google rankings. Of course, this is very controversial, but at least it proves that a small number of HTML code errors does not affect the ranking of web pages in SERPs. In my opinion, if you are not so familiar with HTML, you don't have to insist on passing 100% W3C verification. After all, it is essential to put more time and energy into the areas that you should really work on, such as creating content and links. However, you must ensure that there are no major errors in the HTML code. Of course, if you are quite proficient in HTML, why not spend a little time to make sure it is completely correct? Therefore, we don’t necessarily have to pass W3C certification, but at least we have to ensure that it displays normally in various browsers and that the search engine’s Spider can analyze it normally. Improve the efficiency of HTML code <br />In the previous article, we mentioned the problem of HTML redundancy and bloat caused by many WYSIWYG editors. This situation is quite common on many Chinese websites. WYSIWYG editors such as FrontPage and Dreamweaver often generate a lot of unnecessary redundant codes, especially when modifying a web page. When there is a large amount of redundant code in the HTML file of a web page, the file will become bloated, which will not only slow down the opening speed of the web page and damage the efficiency of the web page, but will also seriously affect the search engine ranking of the corresponding web page. Instead of investing energy in passing the W3C certification, I personally think that it is better to put more energy into streamlining the code, such as introducing CSS, to make the code clean and concise. This optimization effect will be more obvious. |
<<: Docker+nextcloud to build a personal cloud storage system
>>: css input[type=file] style beautification (input upload file style)
1 Introduction Binary log records SQL statements ...
Preface PC Server has developed to this day and h...
Preface This article mainly introduces the releva...
There was an article about the execution process ...
1. CSS3 animation ☺CSS3 animations are much easie...
Table of contents Preface 1. Environment Configur...
css-vars-ponyfill When using CSS variables to ach...
Let's take a look at the dynamic splicing of ...
1. Flex is the abbreviation of Flexible Box, whic...
This article uses an example to illustrate the co...
1. Introduction Image maps allow you to designate...
Table of contents 1. Trigger Solution 2. Partitio...
Aggregating data from various sources allows the ...
First we must understand that a TCP socket in the...
1. Install Docker on the server yum install docke...