Sunday, September 18, 2011

Document type declaration

HTML documents are required to start with a Document Type Declaration (informally, a "doctype"). In browsers, the doctype helps to define the rendering mode-particularly whether to use quirks mode.
The original purpose of the doctype was to enable parsing and validation of HTML documents by SGML tools based on the Document Type Definition (DTD). The DTD to which the DOCTYPE refers contains a machine-readable grammar specifying the permitted and prohibited content for a document conforming to such a DTD. Browsers, on the other hand, do not implement HTML as an application of SGML and by consequence do not read the DTD. HTML5 does not define a DTD, because of the technology's inherent limitations, so in HTML5 the doctype declaration, <!doctype html>, does not refer to a DTD.

An example of an HTML 4 doctype is


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">

This declaration references the DTD for the 'strict' version of HTML 4.01. SGML-based validators read the DTD in order to properly parse the document and to perform validation. In modern browsers, a valid doctype activates standards mode as opposed to quirks mode.

In addition, HTML 4.01 provides Transitional and Frameset DTDs, as explained below.

Related Post

Komentar :

ada 0 comments ke “Document type declaration”

Post a Comment

FOLLOWERS

LIKE PLEASE

ads
CO.CC:Free Domain

ENTRI POPULER

free counters
PASANG IKLAN !!! Bagi rekan-rekan yang ingin mempromosikan sebuah produk dagangannya atau usahanya silahkan hubungi melalui
E-Mail ir_aditya@ymail.com /Telp. 085718404907
Ayo buruan ini harga promo sampai 17 Agustus 2012
Free Website Hosting ads ads ads ads ads
 

© 2009 Fresh Template. Powered by Blogger.

Fresh Template by kangaditya.