Basic Structure of an HTML Document



HTML (Hypertext Markup Language) structure refers to the way in which HTML documents are organized and structured. HTML is used to create web pages, and the structure of an HTML document is essential for web browsers to understand how to display the content of a page.

HTML (Hypertext Markup Language) is the standard markup language used for creating web pages. HTML uses various tags and attributes to the content of a web page. Here is a basic structure of an HTML document:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Heading 1</h1>
<p>This is a paragraph.</p>
</body>
</html>

Let’s break down this structure:

  • <!DOCTYPE html>: This is the declaration that tells the browser that the document is an HTML5 document.
  • <html>: This tag marks the beginning and end of the HTML document.
  • <head>: This is where the metadata of the document is stored, such as the title, description, and keywords. The content inside the head tag is not visible on the web page.
  • <title>: This tag sets the title of the document, which appears in the browser’s title bar.
  • <body>: This is where the visible content of the web page is placed.
  • <h1>: This tag defines a heading, with 1 being the largest and 6 being the smallest.
  • <p>: This tag defines a paragraph.

There are many more HTML tags and attributes that can be used to structure the content of a web page.