Which HTML element tag can be used to store information about a website or its metadata?

August 26, 2021 - 2 min read

The best HTML element to store information regarding a website that is not visible to the user, website metadata, or code that can be read by the system to execute and show the webpage is the head HTML element tag.

For example, the head HTML elements tag is used to add script, styles and, title HTML element tags which are not used by the user directly but are needed by the system to execute and show the webpage to the user.

The head HTML element tag can be written like this,

<!DOCTYPE html>
<!-- Usage of the 'head' HTML element tag -->
<html lang="en">
  <!-- 'head' HTML element tag  -->
  <head> </head>
  <body>
    Hello World
  </body>
</html>

Now inside this head HTML element tag, we can use the meta tags like script, link, title, etc. to supply information to the system for execution or store metadata for other purposes.

For an example, a simple head HTML element tag may look like this,

<!DOCTYPE html>
<html lang="en">
  <!-- 
    'head' HTML element tag with some meta tags 
    used by the system for executing and showing the webpage  
  -->
  <head>
    <title>Hello World!</title>
    <link rel="stylesheet" href="main.css" />
    <script src="js/app.js"></script>
  </head>
  <body>
    Hello World
  </body>
</html>

See the above code live in JSBin.

That's all 😃!

Feel free to share if you found this useful 😃.