DOCTYPE identifier
DOCTYPE is a discument type, is used to explain what version you use XHTML or HTML.
The DTD (see the example below) is called the document type definition, which contains the rules of the document, and the browser explains the identity of your page based on your defined DTD and is displayed.
To establish a standard web page, the DoctyPE statement is an essential key component; unless your XHTML determines a correct Doctype, your identity and CSS will not take effect.
XHTML 1.0 provides three DTD declarations available:
1) Transitional: Requires very loose DTD, which allows you to continue using the ID of HTML4.01 (but to comply with XHTML). The full code is as follows:
2) Strict strict (strict DTD, you can't use any identification and attributes of the performance layer, for example
. The full code is as follows:
3) Frameset: DTD designed specifically for the frame page, if your page contains a frame, you need to use this DTD. The full code is as follows:
HTML identifier
This "xmlns" is an abbreviation of XHTML Namespace called "Name Space" declaration.
Since XML allows you to define your own identity, your defined identity and other people defined the same identity, but represents different meaning. Errors are easily generated when file exchange or sharing. In order to avoid this error, XML uses a namespace declaration, allowing you to identify your identity through a URL.
XHTML is an identifier language of HTML to the XML transition, which needs to meet the XML document rules, so you need to define the namespace. Also because XHTML1.0 cannot be customized, it is the same space, which is "http://www.w3.org/1999/xhtml".
LANG = "GB2312", specify your document Simplified Chinese.
Meta identifier
In order to be properly explained by the browser, all XHTML documents must declare the encoding language they use, we generally use GB2312 (Simplified Chinese), making multi-language page, can also use unicode, ISO-8859-1 Wait, define it according to your needs.
This is written for the old version of the browser to ensure that the various browsers can explain the page correctly.
Note: At the end of the statement, you see a slash "/", which is different from our previous HTML 4.0 code. The reason is that the XHTML grammar rules require that all identities must have started and end. For example,
and body>, and p>, etc. For unpaired identifiers, require the last plus a space, then follow one "/". E.g.
written
, written
, the reason is to avoid the code spaces together browsers do not recognize.
Call style sheet
Designing websites with a Web Standard, the transition is mainly using XHTML CSS, in fact, all of the performance needs to be implemented with CSS. We used to locate and layout with table, and now you have to use DIV to locate and layout.
Inline