What is the HTML page structure? Explain with example

Every HTML page has the same basic structure: a DOCTYPE, then the html element, which has a head (information about the page) and a body (the visible content).

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Page</title>
</head>
<body>
  <h1>Hello</h1>
  <p>Page content.</p>
</body>
</html>
  • <!DOCTYPE html> tells the browser it is HTML5.
  • <head> has the title, charset, styles and scripts. It is not shown on the page.
  • <body> has everything the visitor sees.

More in HTML Page Structure.


Learn more about the similar topics:
Tutorials
HTML Introduction
HTML First Program using Notepad
HTML Page Structure
Exercises & Assignments
Steps to Create a Webpage in HTML using Notepad
Write an HTML program to display hello world.
Write an HTML program to create a page about yourself
Interview Questions & Answers
What is the full form of HTML?
What is DOCTYPE in HTML?
Will HTML5 work without DOCTYPE?
How is the page structure of HTML5 different from previous HTML versions?
What is HTML?
What is the HTML page structure? Explain with example