Understanding Web Standards

Source: Internet
Author: User

A Web standard is not a standard, but a collection of standards. The Web page consists mainly of three parts: structure (Structure), Performance (Presentation) and Behavior (Behavior). The corresponding standards are divided into three aspects: the structure standard language mainly includes XHTML and XML, the performance standard language mainly includes the CSS, the behavior standard mainly includes the object model (such as the ECMAScript DOM), and so on. Most of these standards are drafted and published by the World Wide Web Consortium (abbreviation for foreign languages), and some are standards set by other standards organizations, such as the ECMAScript standard of the ECMA (European Computer Manufacturers Association).

(i) Structural standards

1. Extensible Markup LanguageExtensible Markup Language (a subset of standard universal markup languages, foreign language abbreviation: XML)Web Standard composition。 Like HTML, XML comes from a standard common markup language, and extensible Markup Language and standard Universal Markup language are languages that can define other languages. XML was originally designed to compensate for the lack of HTML, with strong extensibility to meet the needs of network information dissemination, and then gradually used to transform and describe the network data.2. Extensible Hypertext Markup Language can be extendedHypertext Identification Language (foreign language full name: The extensible Hypertext Markup Language, foreign language abbreviation: XHTML). It is recommended to follow the XML1.0 recommended by the January 26, 2000. XML is a powerful alternative to HTML, but it is premature to use XML directly in the face of thousands of existing sites. Therefore, based on HTML4.0, we extend it with XML rules and get XHTML. Simply put, the goal of XHTML is to make HTML transition to XML. (ii) performance of the standard cascading style sheet (foreign language abbreviation: CSS). It is recommended to follow the World Wide Web Consortium (foreign language abbreviation: CSS2) on May 12, 1998. The purpose of creating CSS standards is to replace HTML table layouts, frames, and other expressive languages with CSS. The combination of a pure CSS layout and structured XHTML can help designers separate the look and structure, making site access and maintenance easier. (iii) Standards of conduct1. Document Object ModelDocument Object Model (foreign language Full name: Documents object, foreign language abbreviation: DOM). According to the Web-based DOM specification (http://www.w3.org/DOM/), Dom is an interface with browsers, platforms, and languages that allow you to access other standard components of the page. Simply understood, Dom solves the conflict between Netscaped's JavaScript and Microsoft's JScript, giving web designers and developers a standard way to access data, scripts, and presentation-level objects in their sites.2.ECMAScriptECMAScript is the standard scripting language (JAVASCRIPT) developed by ECMA (European Computer Manufacturers Association). The current recommendation is to follow ECMAScript 262. (d) Code standards1. Must end tagPreviously in HTML, you could open many tags, such as <p> and <li> without necessarily writing the corresponding </p> and </li> to close them.     But it's not legal in XHTML. XHTML requires a rigorous structure, and all tags must be closed. If the label is not paired individually, close it by adding a "/" to the label at the end. For example:
1 <br/> 2 
2. Lowercase element and attribute names
Unlike HTML, XHTML is sensitive to capitalization,<title> and <TITLE> are different labels.  XHTML requires that all labels and attribute names must be lowercase. For example:<body> must be written in <body>. Uppercase and lowercase inclusions are also not recognized, and typically Dreamweaver automatically generates attribute names "OnMouseOver" that must also be modified to "OnMouseOver".3. Tags must be properly nestedBecause XHTML requires a rigorous structure, all the nesting must be in order, the code we wrote before: <p><b></p>/b> must be modified to: <p><b></b> </p> is: A layer of nesting must be strictly symmetric.4. Attributes must be enclosedIn HTML, you do not need to enclose attribute values in quotation marks. In XHTML, however, they must be quoted. For example:5. Special symbols used in the code representationAny less than sign (<), not part of the label, must be encoded as & L T;  Any greater than sign (>), not part of the label, must be encoded as & G T;  Any number (&), not part of the entity, must be encoded as & a M p; Note: There are no spaces between the above characters.6. Assign values to all propertiesXHTML specifies that all properties must have a value, repeating itself without a value. For example: &LT;TD nowrap> <input type= "checkbox" name= "Shirt" value= "medium" checked> must be modified to: &LT;TD nowrap= "nowrap "> <input type=" checkbox "name=" Shirt "value=" Medium "checked=" checked ">7. Symbols that are not used in annotations"--" can only occur at the beginning and end of XHTML annotations, i.e. they are no longer valid in content. For example, the following code is invalid: <!--here is the comment-----------here is the comment--

Understanding Web Standards

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.