tutorialstonight logo
A Platform To Learn To Code

HTML HEAD



The head section is a very important part of the HTML document.

All the information contained inside the head section is not visible in the webpage.

The head section is a container for metadata. Head section lies inside the html section before the body section.

These are the tags used for metadata:

  1. <title> tag
  2. <meta> tag
  3. <link> tag
  4. <base> tag
  5. <style> tag
  6. <script> tag


1).HTML title tag

The title tag defines the title of the HTML document.

It is the content of the title tag that is shown as the heading of the specific search result in the search engine.

The title tag defines the title of the browser tab.

Example

Run the code

2).HTML meta tag

The meta tags are used to provide metadata about the web page.

The data of meta tags are not visible on the web page but are machine parsable.

Using meta tags you can provide data like Keywords, author, page description, last modified and other metadata.

Example

Run the code

3).HTML link tag

The link tag is used to add external stylesheets to the web page.

The href attribute is used to provide URL of the stylesheet and rel attribute is used to specify the relation between the documents.

Example

Run the code

4).HTML base tag

The base tag specifies default url and default target for all relative links of the webpage.

An HTML document can have one and only one base tag and must be inside the head.

Example

Run the code

5).HTML style tag

The style tag is one of the most important tags of HTML documents. It is used to define internal CSS properties for web pages.

It must be inside the head section and CSS properties are defined within the starting and closing tag.

Example

Run the code

6).HTML script tag

The script tag is used to add javascript code or any external javascript file.

It can be anywhere both in the head section or in the body section of the HTML document.

Example

Run the code