HTML Basic Tags


Basically, HTML provide a number of Tags for Hypertext. I will explain few of those tags.Here are some basic tags available in HTML:

<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

Note:Remember that before an opening <html> tag, an XHTML document can contain the optional XML declaration, and it should always contain a DOCTYPE declaration indicating which version of XHTML it uses.

Now we will explain each of these tags one by one. In this tutorial you will find the terms element and tag are used interchangeably.

1. The <HTML> Tag:

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>

Note: As such, start and end HTML tags enclose all the other HTML tags you use to describe the Web page.

2. The <Head> Tag

The <head> element is just a container 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. CheckHTML Base tag.
  • The <object> tag is designed to include images, JavaScript objects, Flash animations, MP3 files, QuickTime movies and other components of a page. CheckHTML Object tag.
  • The <link> tag is used to link to an external file, such as a style sheet or JavaScript file. CheckHTML Link tag.
  • The <style> tag is used to include CSS rules inside the document. CheckHTML Style tag.
  • The <script> tag is used to include JAVAScript or VBScript inside the document. CheckHTML Script tag.
  • The <meta> tag includes information about the document such as keywords and a description, which are particularly helpful for search applications. CheckHTML Meta tag.

3. The <title> Tag

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.

Therefore it is important to use a title that really describes the content of your site. The <title> element should contain only the text for the title and it may not contain any other elements.

4. The <BODY> Tag:

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.
Most of what you will be learning in this and the following five chapters will be written between the opening <body> tag and closing </body> tag.

Putting all Together:

Try it