Document Types

DocType (or document type) declarations tell browsers what type of html code you have written, so that they know how to interpret it. This subject is explained in the references below.

Inclusion of a DocType declaration is simple. A statement such as one of the following is included on the first line of your html document, even before the <html> tag.

DocType Declarations for HTML 4.01 Strict, Transitional, and Frameset

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

See the references if you are not writing Html 4.01.


References on Document Types:

A List Apart

Eric Meyer


W3 Schools DocType


Character Encoding

To be completely correct, you should tell the browser what character set you are using. This is very helpful if you write in languages with non arabic characters. A tag such as the following can do the job:

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

It is included as early in the file as possible, typically right after the <html> tag.

Validation by W3C

Go to this site to have W3C validate your page: W3 Validation Service