Web Standard build Station-xhtml Basic Tutorial 2

Source: Internet
Author: User
Tags add define object contains end lowercase tidy xmlns
HTML Basic |web|web standard |xhtml| Basic Tutorial

Site original content, reproduced please indicate the source Web page teaching network .

  The XHTML DTD defines the type of document.

In XHTML we have to declare the type of document so that the browser knows what type of document you are in, and the declaration part is added to the head of the document. Such as:

<! DOCTYPE DOCTYPE goes here>

<title>title goes here</title>

Body text goes

</body>

Note: The DOCTYPE declaration is not part of the XHTML document and it is not an element of the document, so we do not need to add an end tag.

Note: XHTML attributes are in the

The basic institutions we use when DOCTYPE:

<! DOCTYPE ...>

<title> </title>

<body> ... </body>

DOCTYPE is a shorthand for document type, which is used to indicate what version of XHTML or HTML you are using.

The DTD (for example, XHTML1-TRANSITIONAL.DTD) is called the document type definition, which contains the rules of the document, and the browser interprets the identity of your page based on the DTD you define and displays it.

To create a standard Web page, the DOCTYPE declaration is an essential part of the key; unless your XHTML determines a correct DOCTYPE, your logo and CSS will not work.

XHTML 1.0 offers three types of DTD declarations to choose from:

Transition (Transitional): A very loose DTD that allows you to continue using HTML4.01 's identity (but to conform to the XHTML notation). The complete code is as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Strict (Strict): Requires a strict DTD, you can not use any performance layer of identity and attributes, complete code as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

Framework (Frameset): A DTD specifically designed for frames page design, if your page contains frames, you need to use this DTD. The complete code is as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" >

  How to convert an existing structure to XHTML

What kind of doctype do we choose? Ideally, of course, a strict DTD, but for most of us who have just come in contact with Web standards, the transition DTD (XHTML 1.0 Transitional) is the ideal choice (including this site and the transition DTD). Because the DTD also allows us to use the identity, elements, and attributes of the presentation layer, it is also easier to pass the code checksum of the consortium.

We've taken the following points from the current HTML conversion to XHTML:

A description of the document type is added to the header of each page. Such as:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Of course, you can choose another type.

Both tags and name should be lowercase.

We can write a replacement program ourselves, change all the tags in your HTML document to lowercase letters, and the Name property to lowercase.

All attribute values are enclosed in quotation marks.

Four, separate tags, such as:

V. We open the official website of the Http://validator.w3.org/check/referer: the general error of validation may appear in your tag nesting. You can also use the conversion tools provided by the official website Tidy to implement the conversion: http://www.w3.org/People/Raggett/tidy/, I do not recommend that you use the tool directly to verify, because after all we are a newly-learned XHTML, we still transform ourselves, So we can familiarize ourselves with XHTML, and then we have to learn the use of tidy tools, which is also more troublesome.

Six, we directly open the following page can directly enter the URL to verify our program: http://webjx.com/js/standard.htm

  The modularization of XHTML

Why do you want to modularize the design of XHTML? XHTML is simple, but it's a lot of content, including the vast majority of features a network designer needs. XHTML is a complex subject, but from another perspective it is very simple. To split XHTML into smaller modules, the consortium has built a small, well-defined set of XHTML elements that can be used independently of simple devices that combine large, more complex programs with other XML standards.

Through the XHTML model, programmers can do the following things:

1. Select the elements that are supported by devices that can be used to build block standards for XHTML.

2. Using XML while adhering to the XHTML standard can be extended to XHTML.

3. Simplified XHTML can be applied to devices such as handheld computers, mobile phones, televisions and home appliances.

4. Add XHTML to the design of complex programs by adding the heart's XML functionality (like sound, multimedia).

5. The outline of XHTML is defined as the XHTML base (XHTML for a subset of mobile devices).

Module Name Description
Applet Module * Applet element.
Base Module Define the base element.
Basic Forms Module Defining a basic FORM element
Basic Tables Module Defining a basic TABLE element
Bi-directional Text Module Defines the BDO element.
Client Image Map Module Defines the image map element of the browser.
Edit Module Defines the editing elements del and ins.
Forms Module Defines all elements used in forms.
Frames Module Defining FRAMESET Elements
Hypertext Module Define a element.
Iframe Module Defines an IFRAME element.
Image Module Defines an IMG element.
Intrinsic Events Module Define event Change Property element
Legacy Module Defines deprecated* elements and attributes.
Link Module Defines a LINK element.
List Module Define list element ol, LI, UL, DD, DT, DL.
Metainformation Module Defines a META element.
Name Identification Module Defines the deprecated* name attribute.
Object Module Defines object and Param elements.
Presentation Module Define performance elements such as B and I.
Scripting Module Defines the script and noscript element.
Server Image Map Module Defines the server side image map element.
Structure Module Defines the structure HTML, head, title and body.
Style Attribute Module Define the Style property.
Style Sheet Module Defines a STYLE element.
Tables Module Defines the elements that are applied within a table.
Target Module Defines the target property.
Text Module Define text container elements such as: P and H1.

* expressed disapproval of application to XHTML

Reference documents:

Please refer to Jie's Web Standard site tutorial.



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.