Why do we use head tag in HTML Page?

HTMLWeb DevelopmentFront End Technology

The <head> tag is a container for all the head elements in an HTML page. To add a <head>…</head> the tag is quite easy. Add the title of the document under it or meta information, styles, scripts, etc.

Just keep in mind, the <title>…</title> tags gets added inside the <head>…</head> tags.

Example

You can try to run the following code to add the <head> tag in an HTML page,

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML head tag</title>
   </head>
   <body>
      <h2>Working with HTML head tag</h2>
      <p>This is demo text.</p>
      <p>Displaying how head tag is used in HTML. Add title in it or meta information about the document.</p>
   </body>
</html>
raja
Published on 23-Apr-2018 14:09:50
Advertisements