Summary -

In this topic, we described about the <!DOCTYPE> tag along with detailed example.

The <!DOCTYPE> declaration supports the browser to display a web page properly. This tag is used to understand to understand the version of the HTML is being used. Current version is HTML5 and the declaration like below -

Syntax -

<!DOCTYPE html>

The doctype declaration is not case sensitive. The HTML version and corresponding declaration below -

Syntax -

<!DOCTYPE html>

HTML 4.01

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


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

Example -

<!DOCTYPE html>
		<title> DOCTYPE Example.. </title>
		<!--  Below is the paragraph -->
		<p> Actual Paragraph. </p>