HTML

HTML DOCTYPE Declaration

0
Please log in or register to do it.
HTML DOCTYPE Declaration

Don’t Forget to Add a Doctype : Choosing the right doctype for your HTML documents!

DOCTYPE (Document type declaration) is a dictate that consociate a particular XML or SGML document with a document type definition (DTD)

The HTML DOCTYPE tag is given for defining which version of HTML the document is using in your webpage, this is relate to as the DTD (document type declaration).

You must see <! DOCTYPE> declaration very first in your HTML Document every Page, that is also can see before HTML tags.

DOCTYPE in older version of HTML was Longer because the HTML language was Based on SGML and hence mandatory a reference is to a DTD.

HTML5 would use simple syntax to prescribe DOCTYPE as follows.

<! DOCTYPE html>

On your PC if you see in your web browser like chrome or firefox just right click anywhere on the page except adds and then select “view page source” or easy way press short command Ctrl+U then you can see the source code of the page( in IE Ctrl+u doesn’t work, copy the code and paste in your Note pade and then if you see very first there is DOCTYPE even you can edit text or code whether you need.

HTML5 has grammar and Vocabulary.

Grammar:

Every page in your HTML5 document goes to <!DOCTYPE html>

Vocabulary:

<!DOCTYPE html> means this page  is written in HTML5 as defy to, say HTML 4.01 why, you ask, don’t they just write <HTML5> or even tang <!HTML5> I have perfectly no idea, better to go what they have contain before, here there is one general type of XHTML.

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

HTML 4.01 consist three feasible DOCTYPE, they are in HTML4 strict, transitional and frameset. Any HTML document you can make these three any one of DTD (Document type declaration). These DTD depends on how strict you wish to use HTML and if you are using frames or not.

  • HTML 4 Strict: It is includes all HTML elements except those that have been remonstrate (deprecated) and those that appears in frameset documents.

Example:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
  • HTML 4 Transitional: It is also includes all document type of html elements and including those that which is deprecated, and those that appear in frameset documents.

Example:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
  • HTML 4 Frameset: This type of document includes all HTML elements in the transitional DTD  as well as those in framed document.

Example:

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

HTML Doctype Declaration <!DOCTYPE> :

There are different document types on the web already we have discussed about that html doctype declaration well, and the <!DOCTYPE> declaration aids the browser to expose a webpage in proper way. It disport a document correctly, the browser must grasp both type and version. The <!DOCTYPE> declaration is not delicate, all cases are acceptable.

Example:

<!DOCTYPE html>
<!DOCTYPE HTML>
<!doctype html>
<!Doctype Html>

Common Declarations:

HTML5

<!DOCTYPE html>

HTML 4.01

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

XHTML 1.0

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
HTML Editors
HTML Introduction