🙋🏻 Basic HTML Doctype
A DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in. It is not an HTML tag, but an instruction to the web browser about the version of HTML the page is written in.
The DOCTYPE declaration is not case-sensitive. The DOCTYPE declaration for HTML5 is <!DOCTYPE html>
.
The DOCTYPE declaration must be the very first thing in your HTML document, before the <html>
tag.
Here is an example of a DOCTYPE declaration for HTML5:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
This is a Heading
This is a paragraph.
In the example above, the <!DOCTYPE html>
declaration is the DOCTYPE declaration for HTML5. The <html>
tag is the root element of the HTML document. The <head>
element contains meta-information about the document, such as its title. The <title>
element specifies a title for the document. The <body>
element contains the visible page content. The <h1>
element defines a large heading. The <p>
element defines a paragraph.