Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML <!DOCTYPE> Declaration


<!DOCTYPE html>
<title>Title of the document</title>

The content of the document......

Try it Yourself »

Definition and Usage

All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.

In HTML 5, the declaration is simple:

<!DOCTYPE html>

Browser Support

<!DOCTYPE> Yes Yes Yes Yes Yes

Older HTML Documents

In older documents (HTML 4 or XHTML), the declaration is more complicated because the declaration must refer to a DTD (Document Type Definition).

HTML 4.01:

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

XHTML 1.1:

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

HTML Elements and Doctypes

Look at our table of all HTML elements, and what Doctype each element appears in.

Tips and Notes

Tip: The <!DOCTYPE> declaration is NOT case sensitive.


<!DOCTYPE html>
<!DocType html>
<!Doctype html>
<!doctype html>