Providing Solutions For Web Development Languages and Platforms

Doctype HTML Enhances Web Page Readability For Browsers

doctype html declaration

Doctype HTML Declaration or Document Type Declaration or <!DOCTYPE> is not really a tag. It’s just to inform Web browser about the version of HTML you are using in your document.

Doctype Syntax for document type declaration in HTML5

Syntax to declare doctype for html5 is damn easy as shown a simple declaration below :

<!DOCTYPE html>

Doctype html5 is that much short only. Other versions includes a long doctype declaration which perfectly specifies What does doctype html mean?.

An example showing HTML5 doctype declaration


<!DOCTYPE html> <!--- Doctype HTML Declaration telling browser about the version of html you are using. -->
<html>
    <head>
        <title><!--- Document Title --></title>
    </head>
    <body>
        <!--- Body Area to be shown on Web Browser -->
    </body>
</html>

Actually, different versions of HTML has different way of doctype declaration. Every possible way which describes the doctype html meaning discussed down below.

Browser Support


Element Chrome Edge Firefox Safari
<!DOCTYPE>

Various DOCTYPE HTML Definition, Declarations and Examples


HTML5

HTML5 is not based on SGML for rules specification. That’s why it has only one doctype declaration.

<!DOCTYPE html>

HTML 4.01 was completely based on SGML. That’s why all the rules for markup language was specified by DTD (Document Type Definition) to make browser understand the document perfectly.

HTML 4.01 Strict

This DTD strictly sets the document to be HTML 4.01 Strict. HTML 4.01 gives more importance to Structure over Appearance. Presentational or Deprecated Elements are not included in HTML 4.01 Strict. Best part is that by writing to HTML 4.01 Strict, one can achieve Structure rich documents that can easily adapt to different browsing situations.

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

HTML 4.01 Transitional

This DTD includes all HTML elements and attributes even the presentational or deprecated elements that are not included in HTML 4.01 Strict.

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

HTML 4.01 Frameset

HTML 4.01 Frameset is somewhat similar to HTML 4.01 Transitional except that it allows the use of frames.

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

XHTML 1.0 Strict

This DTD is same to that of HTML 4.01 Strict as it includes all HTML elements and attributes except those which focuses on Presentation. It differs at one point as Markup must be written as well formed XML.

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

XHTML 1.0 Transitional

It is similar to HTML 4.01 Transitional as it contains all elements even presentational. It must also be written as well formed XML.

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

XHTML 1.0 Frameset

This DTD is similar to XHTML 1.0 Transitional. In extra, it allows the use of Frames.

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

XHTML 1.1

It is exactly similar to XHTML 1.0 Strict except the point that it allows addition of modules i.e. you can add ruby support for East Asian Languages.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

HTML 3.2

It is compatible to every browser currently in use. But it does not completely supports Stylesheets and even does not have elements as frames and internationalization.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

HTML 2.0

It is widely supported by most of the browsers. But it doesn’t supports tables, frames as well as most commonly used elements that make better appearance.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Leave a Reply

%d bloggers like this: