We may not notice it at ordinary times, that is, the first sentence that appears on the XHTML page in Dreamweaver. <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Today, when I tune a style, I can easily pull the foreground from. net.CodeCopy it to Dreamweaver and overwrite this sentence. As a result, a small style on the page is always difficult to adjust. At first, I thought it was a style problem, after half a day, I couldn't see the result. I finally went right and didn't find anything, that is, I just missed the first sentence, just adding what I didn't expect.
Check the information and find that doctype is a required element in any web document that complies with the standards. It affects code verification and determines how the browser displays your Web documents.
There are three types of DTD (Document Type Definition) declarations in XHTML 1.0: transitional, strict, and frameset ). Here we will introduce them as follows.
@ Transition
A non-strict DTD that allows the use of html4.01 Identifiers (in line with XHTML syntax standards) on the page ). The format of the Transition DTD is as follows:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional. DTD ">
@ Strict
A strict DTD that does not allow the use of any performance Layer identifier and attributes, such as <br/>. The strict DTD syntax is as follows:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 strict // en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict. DTD ">
@ Framework
A dtd used for a framework page. This DTD is used when the page contains framework elements. The architecture DTD is written as follows:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset. DTD ">
Using a strict DTD to create a page is of course the most ideal method. However, for web designers who do not have a deep understanding of web standards, it is more appropriate to use a transitional DTD. This DTD also allows you to use the identifiers, elements, and attributes of the presentation layer, which is suitable for most website developers.
I have summarized the things that need attention in the future.
1. Only when a correct doctype is determined can the identifier and CSS in XHTML take effect normally.
The 2doctype declaration is placed at the top of the XHTML document, and no HTML comment mark can be added.