DEV Community

Cover image for Which HTML element tag can be used to store information about a website or its metadata?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

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

Originally posted here!

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,

<!-- Usage of the 'head' HTML element tag -->

<!DOCTYPE html>
<html lang="en">
  <!-- 'head' HTML element tag  -->
  <head> </head>
  <body>
    Hello World
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

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>
Enter fullscreen mode Exit fullscreen mode

See the above code live in JSBin.

That's all 😃!

Feel free to share if you found this useful 😃.


Discussion (0)