HTML Tutorial - HTML Head


The <head > tag is the first tag inside the <html > tag. This <head > tag contains many other tag, those tags are <title>, <style>, <meta>, <script>, <link> and <base >.

HTML <title> tag


Every webpage contains the <title> tag as part of the <head > tag. It is used in the ways listed below.
  • Shows the title text in the top of the browser
  • When added as favourite the title text is used
  • It is used by the Search Engines to index the webpages
If you want your webages showing a meaningful title write a proper one. A meaningful title will make your page indexed by the search engine and will be available in the Google/ Yahoo/ Bling search result.

Example:
<!DOCTYPE html>
<html>
<head>
<title>Title goes here...</title>
</head>

<body>
The webpage content here......
</body>

</html>

HTML <base> tag


<base> tag provides the base URL for all the relative URL of the webpage.

HTML Example for <base> Tag
Source: Result:



HTML <style> tag


<style> tag is used to apply CSS style with in the webpage.

HTML Example for <style> Tag
Source: Result:



HTML <link> tag


<link> tag is used to link to an external resourse and the webpage.
<link> tag is used to link to an sytle sheets.

Example:
<head>     <link rel="stylesheet" type="text/css" href="newstyle.css"> </head>

HTML <script> tag


<script> tag is used to write scripts like Javascript.

HTML Example for <script> Tag
Source: Result:



HTML <meta> tag


<meta> tag is used to write data about the webpage and it will not be visible on the webpage. The data iin the <meta> tag is provided in Name/Value pair, details about author, keywords, description, revision etc can be provided.

<meta> tag is used by the search engines to pick the relevant information during the search by users. The keywords provided in the <meta> tag makes the webpage searchable by the search engine. Hence the webpage will be listed in the search result in the top ranking it better than the webapages with out keywords.

HTML <meta> tag Examples


Usage of keywords for search engines:
<meta name="keywords" content="HTML, CSS, SQL, Interactive SQL, Online Tutorial" />

Usage of description of your web page:
<meta name="description" content="Web tutorials on HTML and SQL" />

Usage of the author of a web page:
<meta name="author" content="David" />

Usage of the Refresh document every 30 seconds:
<meta http-equiv="refresh" content="30" />

Usage of the Page Redirection after 10 seconds:
<meta http-equiv="refresh" content="10; url=http://www.FundasMadeEasy.com" />