Sunday 12 April 2015

Document type declaration

Document type declaration ( Or DOCTYPE )

What is Doctype ?

The<!DOCTYPE> is not a HTML tag. It is an instruction to web browser about what version of

HTML the page is written in.

In HTML 4.01, the<!DOCTYPE> declaration refers to a DTD, because HTML 4.01 based on SGML

(Standard Generalized Markup Language). So that the browsers render the content correctly.

It is a top level tag known as a Public Text Identifier

HTML5 is not based on SGML so its not require any reference for DTD.

Explanation of Doctype ?

HTML DOCTYPE statement:-

<!DOCTYPE HTML PUBLIC " - // W3C DTD HTML 4.01 //

EN " " http://www.w3.org/TR/html4/strict.dtd ">
(A) (B) (C) (D) (E) (F) (G) (H)

A pair of forward slash characters ("//") is used as delimiters between keyword fields in the

FPI (Formal Public Identifier) declaration.

(A : Top Element):- Its Indicates the top level element type declared in the DTD
e.g:- For HTML it is <html>.
For XHTMl it is <XHTML >

(B : Availability):- field indicates whether the identifier is a publicly accessible object

(PUBLIC) or a system resource (SYSTEM) such as a local file or URL. HTML/XHTML DTDs are

specified by PUBLIC identifiers.

(C : Registration) - Indicated by either a plus ("+") or minus ("-"). A plus symbol indicates

that the organization name that follows is ISO-registered. A minus sign indicates the

organization name is not registered. The IETF and W3C are not registered ISO organizations and

thus use a "-".

(D : Organization] - This is the "OwnerID" - a unique label indicating the name of the entity

or organization responsible for the creation and/or maintenance of the artifact (DTD, etc.)

being referenced by the DOCTYPE. The IETF and W3C are the two originating organizations of the

official HTML/XHTML DTDs.

(E : Type) - This is the "Public Text Class" - the type of object being referenced. There are

many different keywords possible here, but in the case of an HTML/XHTML DTD, it is "DTD" - a

Document Type Definition.

(F : Label) - This is the "Public Text Description" - a unique descriptive name for the public

text (DTD) being referenced. If the public text changes for any reason, a new Public Text

Description string should be created for it.

(G : Language) - This is the "Public Text Language"; the natural language encoding system used

in the creation of the referenced object. It is written as an ISO 639 language code

(uppercase, two letters.) HTML/XHTML DTDs are usually (always?) written in English ("EN".)

(H : URL) - This is the optional explicit URL to the DTD being referenced.

Type of Doctype ?

HTML 2.0 -

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN">
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level 2//EN">
   

HTML 3.0 -

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
   

HTML 3.2 -

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   

HTML 4.01 -

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

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

"http://www.w3.org/TR/html4/frameset.dtd">
   

HTML 5 -

    <!DOCTYPE HTML>
   

XHTML 1.0 -

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
   

XHTML 1.1 -

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN">
   
For such more blogs you can visit to http://findnerd.com/NerdDigest

No comments:

Post a Comment