Prev | Current Page 57 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

The specification of any XML MIME type, including
application/xhtml+xml, automatically triggers standards mode (see MIME Types
(p. 411) for more details).
How Does it Work?
So how does doctype sniffing work? Which declarations trigger standards mode,
quirks mode, and almost standards mode? The document type definition reference,
for HTML and XHTML, consists of the string PUBLIC followed by a formal public
identifier (FPI), optionally followed by a formal system identifier (FSI), which is
the URL for the DTD.
Here??™s an example of a doctype declaration that contains both an FPI and an FSI:
"http://www.w3.org/TR/html4/strict.dtd">
This example contains only the FPI:

Doctype sniffing works by detecting which of these parts are present in the doctype
declaration. If an FPI is present, but an FSI isn??™t, browsers generally choose quirks
mode, since this was the common way of writing doctype declarations in the old
days.


Pages:
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69