Summary of points to note when using XHTML to make Web pages

Source: Internet
Author: User
Tags expression html tags lowercase
The xhtml| Web HTML Advanced Tutorial is designed to exploit the advantages of HTML, optimize affinity and ease of use.

Because the HTML beginner tutorial and the HTML Intermediate Tutorial hold the position of using the latest HTML standard (more than XHTML version 1.0), it may be difficult for some people who have not read the beginner and intermediate tutorials to understand some aspects of the tutorial, which is why the standard points exist. In general, each part of the tutorial assumes that you understand the HTML inside and out, and further develop its potential.

This tutorial is for those who already understand HTML, but who cannot withstand future XHTML standards, implicitly in the separation of content and expression behind the meaning of the people who have not awakened.

separation of content and performance

HTML has never been a means of expression, but from a client-side combination of elements to format text, developers find ways to manipulate the layout. The powerful CSS makes it no longer necessary to do anything with HTML, and content can be completely detached from the performance (CSS).

There are many benefits to doing this--usually compressing the file capacity, having the flexibility to control the entire site instead of a single page with one main stylesheet, or making the page easier to use and more approachable.

Following these basic principles basically means that you should not use anything that is styled in HTML. For example, the label of font, such as bgcolor properties should not be used. Even the border properties within the image label IMG are illegal in XHTML 1.1 border. Don't worry, outdated HTML can be styled, CSS can be styled, and can be done better.

Rather than stripping the representation out of HTML, the structure of the content means using explicit HTML tags where appropriate. For example, H1,H2 is used in headings--not just CSS to make the font bigger.

The best guide is to use its default style on a visual browser to render a page that has no stylesheet (or a style sheet, but does not support a style sheet, such as a lynx--translator).

tables should not be used on layoutsTables are used to represent tabular data (we've been talking about it many times--the translator's note). Perhaps for the Htmler, which has become accustomed to traditional structures, it is difficult to make a complete change. This method compresses the file to a large extent, and, based on these dominant codes, it becomes more user-friendly and more approachable.

For more information, please read the layout of the CSS Advanced tutorial.

label

All tags in xhtml must be lowercase and closed. No closed labels (such as BR and IMG) must be closed (such as <br/>) with the English half-angle forward slash "/". Note that there should be an English half-width space before the slash.

Tags must also be well-formed so that elements are properly nested (such as <strong><em>this</em></strong> instead of <strong><em>this< /strong></em>).

All documents must have html,head,title and body elements. You must also start with the document type declaration.

The document body should start with P, H1,h2, H3,h4,h5,h6,div, Pre,address,ins, or Del.

Property

All attributes must be lowercase, and their values should be enclosed in English half-width quotes (").

Thin properties are not allowed (such as <input type= "checkbox" checked/>). By convention, a thin property must give the same value as the property name (such as <input type= "checkbox" checked= "checked"/>).

The first name attribute is no longer legal (except in the form element) and should be replaced with an ID.

Target attribute target is not a legitimate attribute. Rejoice, it's a bit of a mania.

In IMG, the ALT attribute is required.

Affinity

The reason for making affinity Web pages for people with disabilities is not self-evident. It is not only humane, but also to the elderly users and features of the functional decline of the user benefit (think about it, one day we are old, the vision subsided, the five senses, how to browse the Internet? For the old product Point de, now consider the affinity bar! --translator note). Affinity is not only convenient for people with severe disabilities, but also makes most users of a small number of fading functions (especially visual) more user-friendly.

The question is increasingly about legal issues, such as the adoption of the "508 article" in the United States, which attempts to actively promote the use of affinity; in the UK, all government websites must have a specified degree of affinity. When can there be legislation like the affinity measures on the building so that it is commonly used on commercial websites? (China does not know when it will have such legislation!) But that does not mean we should not focus on the legality of the Web page we designed. --Translator Note)

If you follow the above suggestions, your HTML should already have a high level of affinity for users with disabilities. There are more creations that make your affinity higher, and not difficult. See the affinity Connection and affinity form guide.

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.