HTML (Hypertext Markup Language) is a fundamental building block of the internet. It is a
markup language used to create and structure content on the web. In this article, we will delve
into the basic structure of an HTML document, its components, and examples.
The Basic Structure of an HTML Document
An HTML document has a basic structure consisting of three components: the document type
declaration, the head section, and the body section. These components define the document's
purpose, structure, and content.
1. Document Type Declaration:
The document type declaration, or DOCTYPE, informs the web browser about the type of
HTML document. This declaration is necessary to ensure that the browser displays the document
correctly. The DOCTYPE declaration is placed at the beginning of the HTML document and
looks like this:
<DOCTYPE html>
This declaration specifies that the document is an HTML5 document.
2. Head Section:
The head section of an HTML document contains information about the document, such
as the title, metadata, and links to external resources. The head section is enclosed
within the <head> and </head> tags. Here is an example of a basic head section:
<head>
<title>My Webpage</title>
<meta name="description" content="This is my webpage">
<link rel="stylesheet" href="style.css">