Understanding the Basic Structure of an HTML Document

Every website or webpage on the internet is created using HTML. HTML stands for HyperText Markup Language. It is used to structure and organize the content of a website.

Every website you see on the internet has an HTML structure behind it. This structure tells the browser how to display videos, images, text, and other content on the page.

HTML is like the skeleton of the human body. Just as the skeleton supports the body, HTML supports and structures a web page.

Before writing any content on a webpage, we must first create the basic HTML structure.

Basic HTML Structure

Below is the basic HTML structure used in most websites.

Example

<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>

<h1>Basic HTML Structure</h1>
<p>This is my first website</p>

</body>
</html>

Each part of this structure has a specific purpose. Let's understand each part step by step.

Doctype Declaration

<!DOCTYPE html>

HTML Tag

<html>

</html>

Head Tag

<head><title> My first webpage </title></head>

Title Tag

<title>My First Web Page</title>

Body Tag

<body> </body>

Heading Tag

<h1> Welcome to My Website </h1>

Paragraph Tag

<p> This is the paragraph tag</p>

How the Browser Reads HTML

When the browser loads a webpage or website, it reads the HTML code from top to bottom.

Writing a proper HTML structure is important because the browser understands each tag and displays the content accordingly.

Why the HTML Structure Is Important

A proper HTML structure is important because:

Conclusion

The basic structure of an HTML document is the foundation of every webpage. It helps the browser understand how to display content correctly.

By using tags like <html>, <head>, and <body>, we can organize the webpage in a clear and proper way.

Learning the HTML structure helps create well-designed and professional websites.