Syntax of Declaring Doctype html public

doctype in HTML

The <!doctype > is the way to declare or instruct your web browser that which version of HTML you are going to use to write a web page. This definition is also called Document type Definition or DTD.

The DOCTYPE HTML public is used for HTML 4.01 version as well as XHTML 1.0. Different types of declarations are shown below.

For HTML 4.01

For HTML 4.01 there are three types of declarations: Strict, Frameset and Transitional. Each will be declared as <DOCTYPE html public> as follows:

For HTML 4.01 Strict

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

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “http://www.w3.org/TR/html4/frameset.dtd”>

HTML 4.01 Transitional

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

Declaration for XHTML 1.0 and XHTML 1.1

XHTML 1.0 also has three types of declarations like HTML 4.01 as follows:

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 Frameset

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.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”>

Was this article helpful?

Related Articles

Leave A Comment?