A web page has a basic structure that helps the browser understand how to display content. Every HTML page follows a standard layout made up of different sections. These sections organize the content and make the page easy to read and manage.
Main Parts of a Web Page
A typical web page consists of three main parts. These are the doctype, the html element, and the head and body sections.
The doctype is written at the top of the page. It tells the browser that the document is an HTML5 file.
The html element is the root of the page. All other elements are placed inside it.
Head Section
The head section contains important information about the page, but it is not directly visible on the screen. It includes the page title, meta information, and links to stylesheets or scripts.
For example, the title shown on the browser tab comes from the head section.
Body Section
The body section contains all the content that users see on the webpage. This includes text, images, videos, links, and other elements.
Everything that appears on the screen is written inside the body section.
Basic Example Structure
Here is a simple example of a web page structure <!DOCTYPE html> <html> <head> <title>My First Page</title> </head> <body> <h1>Welcome to My Website</h1> <p>This is a simple web page.</p> </body> </html>
Why Structure is Important
A proper structure makes the web page easy to understand for both browsers and developers. It also helps in improving readability, maintenance, and search engine optimization.