HTML Tutorial Part-2: HTML Head Tag Elements

HTML Tutorial Part-2: HTML Head Tag Elements

What are HTML head tag Elements?

Image

The HTML head tag element is the container for storing meta data and is between the <html> tag and the <body> tag.

HTML Meta Data is information about HTML Document that is not displayed in the browser.

Meta Data usually refers to the title, character set, style, link, script and other information of the document.

These tags describe metadata: <title>, <style>, <meta>, <link>, <script> and <base>

<base> Element

The <base> element is used to set a basic URL and target for all URLs and target attributes on a web page:

Image

Explanation: The image with the above code will be displayed from the image folder of this website  and for this we did not have to give the path of the image folder. Again, we did not have to set any target for the hyperlink, because we have already set the target in the <base> tag, now if you click on the link, the link will open directly in a new tab. And here href and target are the attributes of the base tag

<title> Element

Tags are used to display the title of any web page in the title bar of the browser.

Image

The code above will show the text “Our HTML Tutorials” in the title bar of the browser.

<style> Element

The <style> </style> tag is used to use the Internal Style sheet. E.g.

Image

<link> Element

The <link> element is used to link the external stylesheet:

Image

<script> Element

<script> </script> tags are used to add scripts like JavaScript, JQuery, etc. E.g.

Image

<meta> Element

Elements are used to indicate character sets, page descriptions, keywords, page authors, and other metadata.

Metadata is used for browsers, search engines and other web services.

To indicate Character Set:

Image

To give the description of Web Page:

Image

To specify key words for search engine:

Image

To indicate the name of the author of the page:

Image

To refresh the document every 30 seconds:

Image

All examples together:

Image

Leave a Reply

Your email address will not be published. Required fields are marked *