The <head> tag is placed between <html> tag and <body> tag and <head> contains important tags like <title>, <link>, <style>, <base>, <meta>, <script> etc.
List of all HTML head tags
<title> HTML Tag
The <title> tag defines the title of the HTML document.
<link> HTML Tag
This tag links External style sheets. External stylesheets are the CSS files(Cascading Style Sheets) which style your HTML document. In laymen terms, CSS makes your website look more attractive and engaging by using style features.
Example of a stylesheet(CSS):
This style sheet is included in the <link> tag under the <head> section as shown in the below example.
<style> HTML Tag
The <style > tag is used to describe style sheet to your HTML document.
<base> HTML Tag
This tag defines the base URI/URL to all other relative URLs. You can set the main URL inside the header using the tag and you can use relative URLs for your other tags like links, images, etc. These relative links or images will use the base URL.
Suppose you have an image at the location below –
Then, you can decide your base location as per your wish. So, you should make sure that once you concatenate(append) your base location and the path defined using <src> attribute, it should be the complete location of your URL.
<meta> HTML Tag
The <meta> tag describes the metadata of the HTML page where it contains page description, author of the page, keywords. Metadata means data about data, so it contains the information about the data. We need to give meta tag inside HTML <head> tag
Refer to the output of this example to understand more about these components.
<script> HTML Tag
Interview Questions & Answer
The head tag is the first element inside the HTML tag. It is used to provide information to the browser about the page and it’s content. SEO techniques,tag,
The meta tag describes the metadata of the HTML page. It contains page description, author of the page, keywords. Metadata means data about data, so it contains information about the data. We need to give meta tag inside HTML tag.
Yes, it is important to usetag in HTML because it is the first element inside the HTML tag. It is used to provide information to the browser about the page and it’s content.