Wednesday, 8 August 2012

HTML Meta Tags


HTML lets tou specify metadata – information about a document rather than document content – in a variety of ways. The META element can be used to include name/value pairs describing properties of the HTML document, such as author, Expiry Date, a list of Keywords, author etc.
The <meta> tag is an empty element and so does not have a closing tag, rather, <meta> tags carry information within attributes, so you need a forward slash character at the end of the element.

Adding Meta Tags to Your Documents:
You can add metadata to your web pages by placing <meta> tags between the <head> and </head> tags. They can include  the following attributes.
Attribute
Description
Name
Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc.
Content
Specifies the property’s value.
Scheme
Specifies a scheme to use to interpret the property’s value.
http-equiv
Used for http response message headers. Fro example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.

The body Element:


The <body> element appears after the <head> element and contains  the part of the web page that you actually see in the main browser window, which is sometimes referred to as body content.
A <body> element may contain anything from a couple of paragraphs under a heading to more complicated layouts  containing forms and tables.

Example:

<body>
     <p>This is a paragraph tag.</p>
</body>



The title Element:


You should specify a title for every page that you write inside the <title> element. This element is a child of the <head> element. It is used in several ways:
·         It displays at the very top of a browser window.
·         It is used as the default name for a bookmark in browsers such as IE and Netscape.
·         Its is used by search engines that use its content to help index pages.
Example:
Here is the example of using title tag.
<head>
<title>HTML Basic Tags</title>
</head>

The head Element:


The <head> element is just a character for all other header elements. It should be the first thing to appear after the opening <html>  tag.
Each <head> element should contain a <title> element indicating the title of the document, although it may also contain any combination of the following elements, in any order:
·         The <base> tag is used to create a “base” url for all links on the page.
·         The <object> tag is designed to include images, Javascript objects, Flash animations, MP3 files, QuickTime movies and other components of a page
·         The <link> tag is used to link to an external file, such as a style sheet or JavaScript file.
·         The <style> tag is used to include CSS rules inside the document.
·         The <script> tag is used to include JAVAScript or VBScript inside the document.
·         The <meta> tag includes information about the document such as keywords and a description, which are particularly helpful for search applications

Example:
<head>
<title>HTML Basic tags</title>
<meta name=”Keywords” content = “HTML, Web Pages” />
<meta name=”description” content = “HTML, Basic Tags” />
<base href=http://www.manish.com />
<link rel=”stylesheet” type =”text/css” href=”tp.css” />
<script type=”text/javascript”>
_uacct = “UA-232293”;
</script>
</head>

The html Element:


The <html> element is the containing element for the whole HTML document. Each HTML document should have one <html> and each document should end with a closing </html> tag.
Following two elements  appear as direct children of an <html> element:
·         <head>
·         <body>

Basic Structure: of HTML


The Basic Structure for all HTML documents is simple and should include the following minimum elements or tags:
·         <html>  -   The main container for HTML pages.
·         <head> -   The container for page  header information.
·         <title>   -   The title of the page.
·         <body> -    The main body of the page.

HTML


Introduction:
HTML stands for Hypertext Markup Language, and it is the most widely used language to write Web Pages. As its name suggest, HTML is a markup language.
·         Hypertext refers to the way  in which  Web Pages (HTML Documents) are linked together. When you click a link in a Web page, you are using hypertext.
·         Markup Language describes how HTML works. With a markup language, you simply “markup” a text document with tags that tell a web browser how to structure it to display.
Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.