HTML Head Element

HTML

The head element is like the header of the web page containing information of the page. Its content is not displayed. We place the head element inside the html tag and before the body tag.

Following are some of the elements that we put inside the head element.

title Tag

The title tag is used to set the title of the web page.

<title>Index Page</title>

meta Tag

The meta tag is used to provide some more information about the html document. For instance, the author of the page or the keywords for the web page.

<meta name="keywords" content="html, tutorial, dyclassroom, videos">

We will learn more about meta tags in the HTML Meta Tags tutorial.

style Tag

The style tag is used to define style within the web page.

<style>
  #user-name {
    font-size: 20px;
  }
</style>

We will talk more about styling in the CSS tutorial.

link Tag

The link tag is used to include external style sheet in the web page.

<link href="default.css">

In the above example we are including an external style sheet default.css in the web page using the link tag.

script Tag

The script tag is used to write javascript code within the same page or include an external script file in the web page.

Following is the javascript code inside the script tags.

<script>
  var text = "Hello World!";
</script>

Following line is used to include an external javascript file app.js inside the js folder in the web page.

<script src="/js/app.js"></script>

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT