Summary -

In this topic, we described about the below sections -

<head> tag is a container for all Head element. <head> tag is of metadata type. <head> tag contains the required tags or elements that are used to link to the document except HTML images. <head> tag will be used only once.

<head> tag is mandatory in HTML 4.01. <head> tag is optional from HTML5. It should start immediately after the <html> tag and closed before <body> tag open.

<head> tag will act as a second level root after <html> tag. The elements can be coded within the <head> tag are

TagDescription
<title> defines the title of the document
<base> specifies the base location from where the links to made
<meta> represents HTML document metadata
<style> used to define styles for the HTML document
<link> used to define link between external resource from HTML document
<script> inserting scripts in the HTML document
<noscript> used if scripting is unsupported or disabled

HTML 4.01 document format -

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Title of the HTML document</title>
    </head>
    <body>
        <!-- Content of the HTML document -->
    </body>
</html>

HTML5 document format -

<!DOCTYPE html>
<html>
	<title>Title of the document</title>
	<body>
        <!-- Content of the HTML document -->
	</body>
</html>

Click on the below respective element or tag to get more detailed information.

TagTag Description
<title> Defines the title of the document.
<base> Specifies the base location from where the links to made.
<meta> Represents HTML document metadata.
<style> Define styles for the HTML document.
<link> Define link between external resource from HTML document.
<script> Define client-side script such as the scripting languages like javascript etc,.
<noscript> Represents alternative content for users when browser doesn't support scripts.