Make our website more standard

Source: Internet
Author: User
Tags html validator tidy css validator

Original link Thank you author

Original version: Http://www.w3.org/QA/2002/04/Web-Quality

Translation: shanghai.ws

Disclaimer: The original version (English version) is the only official version. The Chinese (Simplified) version is translated according to the documents on the website and there may be some errors. Translation does not guarantee complete accuracy. Please take your own risk.

My site is standard! What about you? State

This article was created as a quality assurance interest group work. Please send any public feedback about it to the public file mailing list [email protected] or send a private feedback to [email protected]. The authors thank these people, who have spent their time examining and conceiving.

This article has been translated in multiple languages.

Introduced

You will find here simple, not difficult technology and ideas to improve the quality of your site and make your site effective. This document is dedicated to HTML users, developers working on Web applications, and Web managers.

Most websites in the network are not valid. We might assume this is the case with 99% of pages, but this is not supported by statistical data. It would be interesting to do a survey to prove that this is the case.

Why?

HTML and standard Common comments

I heard a lot of comments and shouts about the subject. Most of this is due to the lack of understanding and understanding of what HTML validation is. Here are a few examples:

  1. Steve, chief executive, said: " if my site was done by standard, it would be tedious and I would lose my client."

    In line with the standards, you can have a very exciting website. Creating a Web site that respects standards has nothing to do with generating plain text pages.

    A series of very cool integrated technologies are now being proposed. You can experience a comprehensive multimedia website that uses existing Web-based collaboration technologies: XHTML (structured XML markup), CSS (style sheets), SVG (2D vector graphics animation), and Smil (synchronous multimedia). These technologies are based on the consensus of different roles in different network markets.

  2. Alan, technical director, said: I don't have the wherewithal to care about the standards on my site. It will cost too much!

    The standard design simplifies site code maintenance because you won't have multiple versions to choose from for different browsers. Your page will have a longer lifespan and will not rely on obscure technology. So, in fact, the design of network standards will cost less.

  3. Dean, art director, said: If I respect the standards, it will undermine my creativity.

    Technical limitations exist in any art, whether you're painting, carving, or designing a Web page. Watercolor or oil painting have their own limitations, but these techniques do not hinder creativity, but they provide the structure of creative expression.

    The creation of network standards will open a new world of technology, especially for the media, technology and readers. There is a lot of exploration in this field. We're just starting to explore the benefits of a standard multimedia experience.

  4. Claudia, a graphic designer, said: I don't care about accessibility. The disabled are not among my target readers.

    You will benefit from the barrier-free design. 8% to 10% of the total population are disabled persons. Websites that follow accessibility guidelines, which are network standards, are easier to maintain. Your website traffic will increase, and more kinds of browsers can access the content to the site.

    Some countries have adopted laws to require accessibility, such as Australia (Disability Discrimination Act 3.1, May 1999), the United States (Chapter NO. 508-Information and applications based on Web intranet and the Internet), and Europe, which runs on a similar plan (information barrier).

  5. Aminata, network programmer, said: Why should I follow the standards? The Internet is a free place.

    The web is a free place, shared by many users who you don't necessarily know they need to share with. The standard is designed to take into account all potential readers. creating in accordance with network standards is a challenge to the network community. You will not be connected to any company or proprietary technology. You can use the technology required by the standalone platform.

  6. Karl, the web developer, said: I just follow the instructions of the book.

    Unfortunately, many books do not teach online programs. When you create a website, you should check the correctness of your markup. If you're a web developer, pay attention to using books to develop your application and read the special specifications you're trying to implement.

    Some websites collect good materials to help people design according to the standards. On the Web site, you can find a more and more tutorials list to promote good practice.

    Some of the people who have developed their own use of free access software we encourage to use them when they can be used. These packages implement the technology of the technologies.

  7. Tim, an accountant, said: My network editor generates non-valid tokens.

    Many authoring tools cannot generate valid tags. Some embed syntax checks, others do it correctly, or many do not generate valid tokens. As an additional workaround, you need to check your Web page using the HTML validator. At the same time, contact the software manufacturer (by mail, phone, letter) to let them know the results. If you ask them, the company will do the right thing.

  8. Valérie, a Web content developer, said: "It's not my fault." Is the method of template engine design. (typically a web-based system).

    You are right. It's not usually your fault. If this is a simple form, you never write HTML with your hand, write the development of your interface or the maintenance of the template website until the problem is solved. If you are unsure of the content that is generated, use an HTML validator to verify it, and then submit the report to your network administrator or to the person responsible for the content management system.

  9. Ning, a software developer, said: No information can help me. All the information I have found is in English.

    Someone has translated the documents and specifications into other languages. A translation list is maintained by the consortium.

HTML is a standard (XHTML is!)

HTML evolves during its evolution, with several versions . All editions are standard and you can choose the one that suits your needs. Most of the time, the newest version will be the best choice unless your goal is a specific reader, or an older, broken browser. The version you choose defines the elements and attributes that you can use.

For example: In HTML 4.01, you will find a list of elements and attributes that allow you to use the page. You can manually edit your page, a method commonly referred to as "hand coding" or "writing source".

HTML 4.01 allows you to write a paragraph and write a stroke identifier for this paragraph, like this:

<p id= "ref" >this is a paragraph</p>

Pay attention to the way you nest your elements. Some elements cannot be included in other elements, and some of them belong to only certain elements.

The elements that you can write in your document or implement in your software depend on the version of HTML. This table contains the definition of HTML that you can use, or the document type (Doctypes):

version DTD List document type declaration in a document
HTML 2.0 ct#
<! DOCTYPE HTML PUBLIC "-//ietf//dtd HTML 2.0//en" >
HTML 3.2 ct#
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 3.2 final//en" >
HTML 4.01 Strict, Transitional, Frameset
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "   http://www.w3.org/TR/html4/strict.dtd" ><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"   "Http://www.w3.org/TR/html4/loose.dtd" ><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 frameset//en"   "HTTP://WWW.W3.ORG/TR/HTML4/FRAMESET.DTD" >
XHTML 1.0 Strict, Transitional, Frameset
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en"   "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-STRICT.DTD" > <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"   "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en"   "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-FRAMESET.DTD" >
XHTML 1.1 ct#
<! DOCTYPE HTML PUBLIC "-//w3c//dtd XHTML 1.1//en" "    http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >

If you do not use one of the document types at the beginning of the document, you will not be able to verify your document. Don't forget it when you write the document manually.

HTML Authoring Tools
All HTML authoring tools must provide a document type and generate markup based on that language.
HTML templates
Any HTML template must have a document type.
HTML Library or template engine (server side)
any HTML library or template engine must return a document type.

Here, you see an example of a strict file template for XHTML 1.0.

<?xml version= "1.0" encoding= "Utf-8"? ><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en"        "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-STRICT.DTD" > 

A strict template for XHTML is very easy to implement. Document modification and validation is straightforward.

Validating file HTML validation

An HTML validator simply checks the correctness of the document for the declared document type.

If you want to verify the validity of your final document, when the document appears on its user agent (for example, a Web browser), you can use the world-class HTML validator. This HTML validator Returns a list of errors for the selected HTML document. If your document has no errors, it will return a message: no errors found! .

If you edit your website with format help (you do not write HTML tags in your format), you can report errors to your Web site's network administrator and require fixed HTML markup generation.

If you create your website manually, or simply organize markup code, the validator will return the error on your page and simply fix your markup. The HTML validator gives you the number of the line where the error occurred.

The HTML validator provides the number of the error line, so it can help you find the problem with the document. It starts with the first line, one row after the check file. This means that errors at the beginning of your document can lead to more errors in your page. A good way to fix a mistake is to correct the first displayed error and then re-verify your page. Usually you will find that fixing the errors in front of the good one document also resolves some errors at the same time. Keep doing this until the error is fixed, and the resulting file will be valid.

If you use an HTML authoring tool and your page is still not valid after editing, report it to a software developer or company. You should be able to contact the company's technical support staff.

    • Amaya-Error Reporting
    • Dreamweaver-Error Reporting
    • FrontPage-Error Reporting
    • GoLive-Error Reporting
    • Homesite-Error Reporting
    • Netscape Composer-Error Reporting

If you are a template engine, creating a tool, or a developer of a content management system, use an HTML validator to fix problems in your implementation. You can also incorporate HTML validators into your software or backend. The source code for the HTML validator is provided free of charge. The authenticator is strengthening every day, and you can participate in its development.

Note : Some documents are valid relative to the DTD, and the relative HTML specification is also incorrect. In the near future, we will present a list of possible errors that are not detected by the HTML validator.

HTML Validator List

    • HTML Validator
    • WDG HTML Validator
    • Doctor HTML
Verify Links

Another important issue with many sites is the persistence of URIs. When you add links to other websites in your documents, you want them to remain stable and persistent. This means that the information point you point to is always there, and when someone else is reading your website, click on the link you gave and still exist. You have to check to make sure that the links you give to other pages or links to other chapters on your own site are not error-free. A tool developed for this purpose: the link check.

Checklink generate a Link report. The length of the report depends on how long it takes to get and check all the links contained in your page. To check the link, the program handles the head HTTP request for a document. If the server is misconfigured, simply because the server cannot give the head, you will get an error report, even if the link is good. In this case, you should write a letter to the website's network administrator and ask him to fix the server configuration.

Checking link Http://webstandards.org/HEAD http://webstandards.org/  fetched in 0.1s

The above is an example of a list. It gives the time to get the link to use.

After the list is linked, you will get a report about which link is bad or redirected and which will help you fix the error link.

If you want to learn more about the importance of links, we invite you to visit this document Cool URIs without changing Tim Berners-lee writing.

If you, as a network administrator, want to install a program on your website to help everyone check their pages, the web link check code is provided free of charge.

CSS validation

Since 1996, cascading style Sheets (CSS) provide a way to separate structures from styles in a concise and efficient way. In the past year (2001), many user agents (browsers) implemented support for CSS 1 and CSS 2. Use style sheets to help you maintain all the information about your documents in a single place.

On the date of writing this article, you can select one of the CSS 1 and CSS 2 to put in your document.

There are many benefits to using style sheet design, such as reducing the design cost of your site and improving its interoperability (the readability of your site on many different user agents). Use tables and JavaScript to design your site for multiple versions of user agents, increasing the initial construction cost by 30%.

Do not FACE use elements with attributes FONT . From an international point of view, this is considered harmful. If you want to learn how to remove your font elements and take style sheets, we encourage you to read Todd Fahrner's tutorial beyond the font tag: A practical HTML text style.

Thanks to the HTML validation service and the CSS validation service, you can check the validity of your stylesheet. You can check the validity of the external style sheet that your document requires. If you want to install your own authenticator on your website, the source code of the CSS validator is provided free of charge.

Verify Barrier-free

It's not enough to make a website. Most of the time you don't know the reader. People who visit your site have different materials, browsers and/or special disabilities. There are many business interests to do Web Access design. Unfortunately, it is rarely possible to directly verify the accessibility of your Web pages. Some tools, such as Bobby, can help you, but they are not the ultimate answer to your barrier-free concerns. You may need to do a check of your content. The Barrier-free web initiative maintains a list of sources that will help you design accessible websites.

Step-by-step tool to improve quality

Often people do not want to verify the site, because the number of invalid pages or because they do not know where to start. In fact, it is very easy, smart point: small, careful, barrier-free, regular, templated . Taking small steps will help you get an effective website that is free of worry and frustration. So, think positively and find a solution that will make your job easier, like using a template engine.

There is a list of tools that can help you get a better site.

HTML Tidy

Tidy was originally developed by Dave Raggett. It can help you make the Web page work. Sometimes tidy can't fix all the errors. Tidy is not an editing tool-he can only help you solve problems.

Top Invalid Docs

Sometimes it is difficult to know which pages of your website are invalid. If you run a script that will slow down all of your pages, you will get a huge list of invalid pages.

So, how to solve?

The W3c,gerald Oskoboiny developed a QA tool for Web sites that are not overloaded with Web site network administrators. It sends a report of the most invalid access to the top 10 documents to provide notification so that they can be corrected. Every week, the network administrator receives a new report of 10 invalid documents. The tool has been released to the public. You can use it according to your needs.

Olivier THÉREAUX,W3C, developed a more portable and more pluggable version of this tool: Logvalidator

This tool requires the last record of the Web server and its processing through the Effectivity module. These effectivity modules examine a specific technique for the effectiveness of the most common documents. The default template is the HTML validator, but it also provides other validators.

So, you can fix the spelling of your Web page, whether it includes metadata, whether the connection is valid, and so on. An API recommendation will help you create a new template as you need it.

Thank

Thanks to the people who reviewed this article: Ian jacobs,susan lesch,olivier Théreaux,stephanie Troeth,jeffrey Zeldman, and Public-evangelist The people in the mailing-list.

If there is no review and help my technical writer Kim Nylander's participation, there will be no such article.

Make our website more standard

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.