Head Tag

There are some special tags in HTML.

The head tag <head></head> is a container for tags such as title, meta, link, etc.

  • none of the stuff you put inside it should be visible.

It tells the browser more about the website itself and what resources should be loaded additionally.

<!DOCTYPE html>
<html>
  <head>
    <!-- title, meta, script, link ... -->
  </head>
  <body>
    <!-- p, h1, div, span ... -->
  </body> 
</html>

Title Tag

Title tag sets the website’s name.

<title>Home Page</title>

Meta Tag

You can set the

  • author
  • description
  • keywords
  • charset, etc.

of the website.

Meta tags usually consist of the name, content or property attribute.

<meta name="author" content="Sam Yung" />
<meta name="description" content="How to get a 40 kill streak in a COD lobby." />
<meta name="keywords" content="Gaming, Computer" />
<meta charset="UTF-8" />

One good practice is to add a meta tag that sets the viewport to the following value.

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

It makes the website look a bit nicer across different devices.

 

Last edited on 10/04/2024