Declare the Doctype of an HTML Document

What is !DOCTYPE:-


 A doctype is essentially a protocol that dictates how each element on the page should be displayed, which tags are valid etc. The existence of doctypes, means that web browsers can be developed against this doctype, to ensure they render all elements correctly.
you tell the browser that the browser which version of HTML your page is using by adding <!DOCTYPE.........> tag on the first line where the(........) part is the version of HTML. for HTML5 you use <!DOCTYPE html>. The "!" and uppercase DOCTYPE is important especially for older browser.

For Example:

<!DOCTYPE html>
<html>
<head>
<title> web page title name </title>
</head>
<body>
<h1> your first heading </h1>
<p> your paragraph </p>
</body>
</html>

Output:













Please Share To Other:

Post a Comment

0 Comments