Aug 30, 2026

Introduction: HTML head | HTML body

 <html> 

 <head> 

<title> My First Page</title>

 </head> 

 <body> 

 < h1 > First Page! < /h1 > 

 <p>First Paragraph!</p > 

 <p> 2nd Paragraph </p>

 </body > 

 </html>

 Whenever we write a web page, the whole of the page is contained between the opening <html> and closing </html> tags. 

Inside the < html > element, there are two main parts to the page: 

The < head > element: 

This contains information about the page. 

For example, 

It might contain

  • a title and 
  • a description of the page, or 
  • instructions on where a browser can find CSS rules that explain how the document should look. 

It consists of the opening < head > tag, the closing < /head > tag, and everything in between. 

The < body > element: 

This contains the information.  

We actually see in the main browser window. 

It consists of the opening < body > tag, closing </body> tag, and everything in between. 


Together, the < html > , < head > , and < body > elements make up the skeleton of a document.

 Inside the < head > element of the first example page, you can see a < title > element: 

 < head > 

        <title> My First Page</title> 

 < /head > 

 <title> Tag for the Title of  Document's Page.

It's displayed on the right at the top of the browser (Such as Firefox, Chrome) window. 

  • It is also the name browsers use when you save a page in your favorites, and 
  • It helps search engines understand what your page is about. 


 The real content of your page is held in the <body> element, which is what you want users to read, and this is shown in the main browser window. 

 The < head > element contains information about the document, which is not displayed within the main page itself. 

The < body > element holds the actual content of the page that is viewed in your browser. 

📝 Just remember ! 

An element that contains another element is known as the parent, 
while the element that’s between the parent element’s opening and closing tags is called a child of that element. 

So, the < title > element is a child of the < head > element, the < head > element is the parent of the < title > element, and so on. 

Furthermore, the < title > element can be thought of as a grandchild of the < html > element. 


No comments:

Post a Comment

Thank you to visit Bapi's Page.