Skip to main content

HTML Page Structure Explained (Beginner Friendly)

In the previous lesson, we learned what HTML is. Now let’s understand how an HTML page is structured. Every webpage follows a basic structure made of important HTML tags.

HTML structure = Skeleton of a webpage.

Basic HTML Page Structure

Here is the simplest form of a complete HTML page:

<!DOCTYPE html>
<html>
<head>
  <title>My First Webpage</title>
</head>
<body>
  <h1>Hello World!</h1>
  <p>Welcome to my webpage.</p>
</body>
</html>

Let’s understand each part

1. <!DOCTYPE html>

This tells the browser that the document is an HTML5 webpage. It is always written at the top.

2. <html> ... </html>

This is the root tag. Everything inside the webpage is written between these tags.

3. <head> ... </head>

The head section contains information about the webpage such as:

  • Page title
  • SEO meta tags
  • CSS files
  • Scripts
Example:
<head>
  <title>My Website</title>
</head>

4. <title> ... </title>

This sets the page title that appears on the browser tab.

5. <body> ... </body>

The body is where all visible content goes, such as:

  • Text
  • Images
  • Buttons
  • Links
  • Videos
  • Forms
Example:
<body>
  <h1>My Webpage</h1>
  <p>This is my first website!</p>
</body>

Complete Example with Explanation

<!DOCTYPE html>
<html>
<head>
  <title>Simple HTML Page</title>
</head>
<body>
  <h1>Welcome!</h1>
  <p>This page shows the structure of HTML.</p>
</body>
</html>

Where to write HTML code?

You can practice HTML in:

  • VS Code (recommended)
  • Notepad
  • Mobile apps like Acode or WebCode
  • Online editors like CodePen or JSFiddle

Summary

  • <!DOCTYPE html> – defines HTML5 document
  • <html> – main container
  • <head> – browser information
  • <title> – page name in browser tab
  • <body> – visible content

In the next lesson, we will learn HTML headings and paragraphs with examples.

Comments

Popular posts from this blog

HTML Tables Tutorial — Learn Tables with Examples Tables organize tabular data (rows & columns). They are great for schedules, price lists, spec sheets, comparison charts, and any data that fits a grid. This guide covers: Table basics: <table> , <tr> , <td> , <th> Headers, captions, and groups ( <caption> , <thead> , <tbody> , <tfoot> ) Colspan & rowspan Styling and responsive tables Accessibility and best practices Table of Contents Basic Structure Headers & Captions Colspan & Rowspan Grouping Rows: thead / tbody / tfoot Styling Tables Responsive Tables Accessibility Tips Practical Examples Best Practices 1. Basic Structure Minimal valid table: <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table> Elements: <table> — container for the table <tr> — table ...
HTML Forms Tutorial HTML Forms Tutorial HTML Forms allow users to enter and submit data. They are used everywhere—login forms, signup forms, search boxes, feedback forms, etc. In this complete tutorial, you will learn all form elements with examples and demos. 1. What is an HTML Form? A form collects user input using different form elements like text fields, checkboxes, radio buttons, buttons, and more. <form> Form elements go here... </form> 2. Basic Form Structure <form action="#" method="post"> <input type="text" placeholder="Enter name"> <button>Submit</button> </form> Submit Attributes: action → URL where form data is sent method="POST" → Secure data sending method="GET" → Data shows in URL 3. Text Input Field <input type="text" placeholder="Your Name...
What is HTML? A Beginner-Friendly Explanation If you want to become a web developer, HTML is the first language you should learn. It is the foundation of every website on the internet. In simple words: HTML (HyperText Markup Language) is used to create the structure and content of a webpage. Why HTML is important? Websites cannot exist without HTML It is simple and beginner-friendly Used with CSS and JavaScript Works on all browsers How does HTML work? HTML is made of tags . Tags tell the browser what type of content is being shown. Example of an HTML tag: <p>This is a paragraph.</p> Here: <p> is the opening tag </p> is the closing tag The text inside is the content Basic HTML Page Example Below is a simple webpage example you can try: <!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>Hello World!</h1> <p>This is my...