Web Authoring Experience: Writing efficient HTML Web page code

Source: Internet
Author: User
Tags closing tag html page html validator valid client
Web page increase the efficiency of your HTML code

Many web designer's most common mistake is that when its web page can be in the normal display of IE that the code is correct, and even often see someone complaining about their site rankings are not ideal, to their site to simply look at it can be found in the HTML code filled with a variety of errors, On the basis of that code no matter how much effort to optimize the site results may be put into the water! In fact, IE is a very high tolerance for HTML code of the browser,--to say the digression, although we can have a variety of reasons to attack Microsoft, but Microsoft's product operation of the changes in the hands and availability of the efforts are not to be obliterated. --web page can be in the normal display of IE does not mean that the page's HTML code is not a problem, even by extension, the Web page in a variety of browsers can be normal display does not mean that the HTML code is completely legitimate and effective, after all, which browser to ensure the basic fault-tolerant function, otherwise, Occurs even if the HTML page is not displayed properly because of a single point in the network transmission, which is still frequent today when network bandwidth remains tense.

What is a valid HTML code

In short, our web pages are made up of HTML (hypertext Markup Language: Hypertext link Markup Language) elements, even for dynamic pages such as ASP and PHP, It is also the server that renders ASP or PHP statements to the corresponding HTML elements and uploads them to the client, and the JavaScript and so on the client converts them to HTML.

As with other languages, HTML has its own syntax rules, both browser and search engine spider are based on these rules to analyze the content of the Web page code. But most of the time, even for skilled people, the HTML page is built with some errors on the HTML code, not to mention most of the WYSIWYG editor caused by the bloated HTML redundancy problem.

If there is no component in the page that violates the HTML standard syntax, it can be called a valid HTML code

The importance of legitimate and valid HTML code for SEO

To enable search engines to include our web page,--on this basis to talk about site optimization site promotion-The premise is to let search engine spider can read our web files. Search engine Spider reading Web page is based on HTML specification, through the analysis of HTML code, spider can judge the content of the Web page, on this basis to judge the relevance of the corresponding keyword.

It needs to be clear that the search engine spider is different from the browser is its fault tolerance compared to the browser is much worse, if the page code in the presence of its inexplicable HTML code, it may stop reading the page may even stop crawling in our site, Even more serious errors can cause it to discard content information from other pages in the site that have been collected.

Although today's major search engines are also trying to improve spider's fault tolerance, they can not affect the collection of content when the HTML code has a generic error. But most of the time, it still happens if a closing tag causes the entire page's content to be ignored.

On the other hand, legitimate and effective HTML can also ensure that the Web page can be interpreted in a variety of browsers, to avoid the same page in IE under the normal under the Mozilla but seriously distorted situation (of course, can not be completely avoided), which to improve the usability of the site is also a great benefit.

How do I verify that the HTML code is valid?

The internet has a number of similar free services that can help us verify the legality and validity of our web code, the most famous of which is the Htmlvalidator, a free service launched by the World Wide Webconsortium: Web Consortium. On its page, simply enter the HTML address to be validated or upload an HTML file on the local machine, and it will quickly return the checksum, whether it is correct, if there are errors, and how to improve.

At the same time, the HTML validator also provides validation services for CSS files.

Must you pass the verification of the consortium?

The answer to this question is not so absolute.

In theory, legitimate HTML code can make it easier for search engine spider to collect content information from Web pages. On the other hand, not all of the HTML code errors will affect the spider crawl, that is to say, there are a small number of errors in HTML is also acceptable to spider, then, must be certified through the world of the consortium?

On the other hand, as in Mark Daoust's test, even the metaphor (not conclusive) there are a few HTML code errors in the page in the Google rankings can be more dominant, of course, there is a lot of controversy, but at least proved that there is a small number of HTML code errors do not affect the page in the SERP

Personally, if you are less familiar with HTML, do not have to insist on 100% through the verification of the consortium, after all, put more time and energy to really should strive for the direction such as creating content and links is fundamental, but to ensure that there is no large severity error in the HTML code. Of course, if you are proficient in HTML language, then why not take a little effort to make sure it is absolutely correct?

Therefore, we do not necessarily have to go through the authentication of the spider, but at least to ensure that it in a variety of browsers to display normal, to ensure that the search engine can be normal analysis.

Increase the efficiency of your HTML code

We have mentioned that many of the WYSIWYG editors create a bloated HTML redundancy problem, which is quite common in many Chinese websites. WYSIWYG editors such as FrontPage, Dreamweaver, especially when they make changes to a Web page, often produce a lot of unnecessary redundant code. When the page's HTML file in the presence of a large number of redundant code, the file will become bloated, which will not only reduce the speed of web pages, damage to the efficiency of the Web page, but also seriously affect the search engine rankings of the page.

Instead of devoting energy to a certain amount of authentication through the consortium, I think it is better to put more effort into the code, such as the introduction of CSS, to achieve clean and concise code. This optimization effect will be more obvious.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.