How To Declare Doctype via HTML for Your Website?


Your website is like an online business card: the way it is organized on the outside, as well as on in the inside says a lot about you and your personal or corporate brand. And in order to make your website fully functional, you have to work on in from the inside out. We’ve discussed here other topics, such as Google indexation, 404 error pages, sitemaps, Google webmaster tools and robots.txt. Today we discuss about how you can declare doctype using HTML.

What s Doctype Declaration?

Doctype declaration is a code that sends instructions and information to the web browser about the version of HTML the page is written in. This is not a HTML tag, one of the reasons why it must be declared before the <html> tag.

How Do I Declare Doctype in HTML?

First off, you have to insert the “!DOCTYPE” function before the <html> tag. See example below:

<!DOCTYPE html>

What Type of HTML Works with Doctype?

DOCTYPE Declarations vary on type of HTML you are using in your page. In some HTML types, a DTD must be specified so that the browsers render the content correctly. See examples below:


<!DOCTYPE html>

HTML 4.01 Strict


HTML 4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "">

XHTML 1.0 Strict

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

XHTML 1.0 Transitional

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

XHTML 1.0 Frameset

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


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">

Now you are just steps away from having a website that performs great on the web! Check back for more tutorials.