Head Section of HTML Page

What is the head section of an HTML page?

In an HTML document the head section contains the information about the document. It has the title of the page and Meta tags which describe many things for the page. For example what character set the page or document will be using and how it’s rendered how it will be navigated how it is assembled and describes how otherwise the document works. Let us look at the following code and understand it more.

Code:

<!DOCTYPE html>

<!—Head section of an HTML document. howtocode.pk -->

<html lang="en">

<head>

<meta charset="UTF-8" />

<title>

HTML Page Title Goes Here.

</title>

<link rel="stylesheet" type="text/css" href="mystyles.css" />

</head>

<body>

<h1>

HTML Body Section | howtocode.pk

</h1>

<p>

Using character references I can display HTML tags like this:

</p>

</body>

</html>

Here you can see that in the head section there are some tags. The things that go in the head section are considered to be in the Meta data content model. It includes many elements like Meta, title, link, script, base and style elements. In the head section you can see that the first tag which is there is a Meta tag which tells the browser that what character set will be used in the document. The next one is the <title> tag which is necessary even it is empty. It should be just one title element in a web page. In old days of html it was allowed to put multiple titles but it is not supported any more in the modern browsers.  The next element or tag is the link element which is used to build relationships with other documents. Like in the above code we are linking a stylesheet or a css file to our html document. This is the purpose of using link element in a head section generally. But it can be used to link other files with this html document not done generally.

Comments