When encountering a page without a DOCTYPE, many browsers
go into what is known as Quirks mode, a backwards-compatibility
feature supported by Mozilla, Internet Explorer 6 for
Windows, and Internet Explorer 5 for Macintosh.
In Quirks mode, the browser functions as if it has no knowledge
of the modern DOM (document object model) and pretends it
has never heard of Web standards. This ability to switch modes
depending on the DOCTYPE, or lack thereof, enables browsers
to do the best possible job of interpreting the code of both standards-
compliant and noncompliant sites.
Note that for some weird reason, the DOCTYPE tag does not need
to be closed with a slash and DOCTYPE is always in caps. This
entirely contradicts XHTML rules 4 and 7 below. Go ?¬? gure.
2. Declare an XML namespace. Note this line in your new html
tag. Here??™s an example:
lang="en">
When a browser is handling an XHTML page and wants to
know what??™s in the DTD, which lists and de?¬? nes all the valid
XHTML tags, here??™s where it can ?¬? nd it: buried away on the
servers of the WC3.
In short, the DOCTYPE and namespace declarations ensure that
the browser interprets your XHTML code as you intended.
3. Declare your content type. The content type declaration goes
in the head of your document, along with any other meta tags
you may add.
Pages:
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40