Preface
Hello everybody! This series of articles is written W3CN Ah Jie. Some experience in the production process and experience, we want a little help.
Also, thanks for sharing with us Acha experience and knowledge. Well, let us begin
First day
Started making standard sites, the first thing is a statement consistent with their needs DOCTYPE.
WEB2.0 standard web pages of the original code, the first line is:
<! DOCTYPE html PUBLIC “- / / W3C / / DTD XHTML 1.0 Transitional / / EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
Open the site that meet the standards, such as the famous web design software developer Macromedia, designers Zeldman’s personal website, you will find the same code. The other sites that meet the criteria (for example k10k.net) code is as follows:
<! DOCTYPE html PUBLIC “- / / W3C / / DTD XHTML 1.0 Frameset / / EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>
So these codes mean? Have to put it?
What is a DOCTYPE
The above code we called DOCTYPE declaration. DOCTYPE is the document type (document type) the abbreviation used to describe you are using what version of XHTML or HTML.
One of the DTD (for example, in the example above xhtml1-transitional.dtd) called the document type definition, which contains the rules of the document, the browser according to your DTD to explain the definition of the identity of your page and show it.
To create a standard page, DOCTYPE declaration is an essential key component; unless you set a correct XHTML DOCTYPE, otherwise your logo and CSS will not take effect.
XHTML 1.0 DTD declaration provides three options:
Transition (Transitional): requires a very loose DTD, which allows you to continue to use HTML4.01 identity (but the wording to comply with xhtml). 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): demanding DTD, you can not use any logo and the presentation layer properties, such as
. Complete code is as follows:
<! DOCTYPE html PUBLIC “- / / W3C / / DTD XHTML 1.0 Strict / / EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
Framework (Frameset): page design specifically for the framework to use DTD, if your page contains a frame, you need to use this DTD. 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”>
We choose what kind of DOCTYPE
Ideally, of course, is a strict DTD, but for most of us designers new to web standards, the transition of the DTD (XHTML 1.0 Transitional) is the ideal choice (including the site, also use transitional DTD). Because the DTD also allows us to use the identity of the presentation layer, elements and attributes, and also more easily through the W3C code validation.
Note: The above said “the identity of the presentation layer, the property” is used to control the performance of those who simply tag, for example for the form layout, background color, logo and so on. Identified in the XHTML is used to represent the structure, not used to achieve expression, our aim is to eventually achieve the transition of data and performance of phase separation.
Analogy: mannequins dressed. Like the data model, clothing is a form of expression, separation of models and clothes, so you are free to change clothes. HTML4 in the original data and performance is mixed together to form a one-time performance is very difficult to change. Oh, a little abstract, this concept requires us to understand step by step in the application process.
Added
DOCTYPE declaration must be placed on top of every XHTML document, code and logo on all.
More details can access the W3C Web site
Related posts:
- how to apply the standards to improve the existing WEB site? Most of our designers are still using the traditional form...
- To achieve More div arranged Center To achieve More div arranged Center <?xml version=”1.0″ encoding=”iso-8859-1″?> <!DOCTYPE...
- The second day : What is the name space ? Well after the DOCTYPE declaration, the following code: <html xmlns=”http://www.w3.org/1999/xhtml”...
- The third Day : definition language code The third step is to define your language code: <meta...
Related posts brought to you by Yet Another Related Posts Plugin.

