HTML <!DOCTYPE html> tag

You are Here:

HTML <!DOCTYPE html> tag

The <!DOCTYPE html> tag helps the browser to determine which version your html file belongs.

The <!DOCTYPE html> tag must be declared as a first thing in your HTML document, before the <html> tag.

Tips: The <!DOCTYPE html> is NOT case sensitive.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <p>doctype helps the browser to find html version.</p> </body> </html>

Attributes

There is no special attributes for <!DOCTYPE html> tag.

Doctype Declarations

The following example provides a Doctype Declarations of all versions of HTML.

Example

HTML Online Editor
<!-- html 5 --> <!DOCTYPE html> <!-- html 4.01 Strict --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!-- html 4.01 Transitional --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- html 4.01 Frameset --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <!-- XHTML 1.0 Strict --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dt"> <!-- XHTML 1.0 Transitional --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- XHTML 1.0 Frameset --> <!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" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author