WEB standard tutorial: how to apply WEB standards to improve existing websites?

Source: Internet
Author: User

Most of our designers are still using traditional forms of layout, performance, and structure to build websites. Learning to use XHTML + CSS requires a process that makes it impossible for existing websites to comply with website standards in one step. The best way is to gradually achieve the goal of fully complying with website standards in stages. If you are a newbie or not familiar with the code, you can also use a standard-compliant editing tool, such as Dreamweaver MX 2004, which is currently the most complete tool supporting CSS standards.
1. Primary improvement
Add the correct DOCTYPE to the page
Many designers and developers do not know what DOCTYPE is, what is the use of DOCTYPE. DOCTYPE is short for document type. It is mainly used to describe the XHTML or HTML version you are using. The browser interprets the page code based on the DTD defined by DOCTYPE (Document Type Definition. Therefore, if you do not pay attention to setting the wrong DOCTYPE, the result will surprise you. XHTML1.0 provides three DOCTYPE options:
(1) transition type (Transitional)
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(2) Strict)
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
(3) framework (Frameset)
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Frameset // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
For our initial improvement, we only need to choose a transitional declaration. It is still compatible with your table layout and presentation logo, so that you do not feel that the changes are too great and difficult to grasp.
Tip: If you are too lazy to enter the above transitional code, you can visit the first page of http://www.macromedia.com/website. Then you can paste the source code with the same header code.
Set a Namespace)
Add the following code directly after the DOCTYPE declaration:
<Html XMLns = "http://www.w3.org/1999/xhtml">
A namespace is a detailed DTD that collects element types and attribute names. The namespace declaration allows you to identify your namespace through an online address. Just enter the code.

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.