Grow your CSS skills. Land your dream job.

Last updated on:

The Common DOCTYPES

HTML 4.01 Strict

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

XHTML 1.0 Strict

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

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.1

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

HTML 5

<!DOCTYPE html>

Comments

  1. flofies
    Permalink to comment#

    At last someone had the idea and made it real ! Thank you very much / looking forward to seeing that redesign.

  2. Ant
    Permalink to comment#

    I prefer HTML 4.01 Strict, but soon may migrate to

  3. The HTML5 (space or no-space?) Doctype also covers everything previously so there’s no reason to not use it now.

    It triggers standards mode in IE and works correctly in all other browsers, the main reason for doctype is for validators anyway so as long as you don’t the ‘this is as yet an unfinished spec’ style of message, you’ve nothing to worry about.

    • Permalink to comment#

      So all the old IEs need is a doctype declaration to trigger the standards mode? No matter what version of it?

  4. Ant

    HTML4 strict is my favorite. I’ll move to in future.

  5. Permalink to comment#

    can u tell me the doctype for mobile html

    • Permalink to comment#

      Same Doctype should work in all the browsers irrespective of the platform you are in.

  6. Permalink to comment#

    tell me the doctype for mobile web

    • Evan
      Permalink to comment#

      @ neha,
      The layout of your html/css/js is what determines a mobile design. There is no doctype specifically for mobile.

Leave a Comment

Posting Code

Markdown is supported in the comment area, so you can write inline code in backticks like `this` or multiline blocks of code in in triple backtick fences like this:

```
<div>Example code</div>
```

You don't need to escape code in backticks, Markdown does that for you. If anything screws up, contact us and we can fix it up for you.

*May or may not contain any actual "CSS" or "Tricks".