What is the head section in HTML?

By: Ravindra Kumar | 04 May 2019


Ankush Singh

05 August 2020

Head section in HTML

An HTML page divided into two main parts (HTML page is also called as HTML document)

  1. Head Section
  2. Boby Section

Both the Head section and Body section are rendered between main <html> and </html> tags. Below is the structure of an HTML document (HTML Page)





Between <body> and </body> tags we put all other tags, images, text, etc. which we want to show in our web page, In simple words whatever we put between <body> and </body> that is going to appear in our web page but in case of <head> tag is totally different, so let's know why we use the head tag in the HTML page

The Head section is used to control the complete HTML page ( mainly body section) for that how the page will behave and appear. Let's take a real-world example, take the example of your body, suppose your whole body like an HTML page in which there is a mind which is invisible, and second is your rest of the body. Your mind gives instructions to your body and your body does the task accordingly, for example, moving your hand, speaking, walking, etc. People can see your body that how it looks like but they can't see your mind. The HTML page works same, <head> </head> tag is used to control the complete HTML page. Below I'm going to list points about that we do in the head section.

All code which we want to write in the head section we write between <head> and </head> tags.

1. Page Title

In head section we use <title> </title> tag to provide a tile to our webpage. In the web browser title text appears above the URL.

The <title> tag is optional but it is good practice to use <title> tag it helps search engine to rank your web page in the search result.


          <title>Home Page</title>


2. Meta Tags

Meta tags are basically used for SEO purpose in with we tell to search engine that do we want to rank our page or not, if we want to rank page then on which keywords and description, don't worry it these this are new for you, these are the parts of SEO, you will learn it after learning HTML


         <meta name="keywords" content="home page, home," />


3. CSS/ JavaScript Codes

In the head section, we can write required CSS and Javascript code, it is good practice to write CSS and Javascript code in head section rathe than inline CSS because it is reusable and easy to maintain.








                   p {





4. External CSS/ Javascript / JQuery Files Link

The Head section allows us to like our external CSS, Javascript, JQuery files in our HTML page, we put all such links between <head> and </head>


         <link href="../style/site_style.css" rel="stylesheet" />


11 votes


Nirmal KJ

11 May 2019

We can use some important tag between the head opening <head> and closing tag </head>

  1. A title tag <title> for the web page title, 
  2. Link tag <link> use for external CSS code, 
  3. Javascript tag <script> use for external javascript code, 
  4. Meta tag <meta> in the head section of HTML.

1 votes


Pankaj Kumar Tripathi

25 June 2019

The HTML head section uses to provide some important information about the web page for example - Page title, external CSS link, external script link, internal CSS & Script code, etc. The basic structure of the HTML Head section mentioned below:



              <title>Web page Title Name</title>

              <link />Here we can link a external css file

              <script />Here we can link external script file

              <style>Internal CSS code, we can write here</style>

              <script>Internal Script code, we can write here</script>



1 votes

Your Answer

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at ""

© 2021 GDATAMART.COM (All Rights Reserved)