You are on page 1of 6

HTML

Introduction
Hypertext Markup Language (HTML) is the text markup language currently used on the World Wide Web. HTML is a tool for distributing information on the Web or on an Intranet. This information can be any message you wish to communicate to another individual and are not limited to text forms. It can be expressed as image, sound also. This information is distributed through a networked environment called the World Wide Web.

Hypertext is the ordinary text that has been dressed up with extra features, such as formatting images, multimedia and link to other documents.

Markup is the process of taking ordinary text and adding extra symbols. Each of the symbols used for markup in HTML is a command that tells a browser how to display the text.

Language is a key point to remember about HTML. It has its own syntax and rules for communication.

HTML Overview
HTML is simply a collection of codes, which are called as elements. These are used to indicate the structure and format of a document. Elements in HTML consist of alphanumeric tokens within angle brackets. Most elements consist of paired tags: a start tag and an end tag. Most tags come in pairs, but not all. HTML specifications define the type of content an element can enclose. This is known as an element's content model. The content options include other elements, text or nothing at all. For example, the <HEAD> element provides general information about an HTML document. Its content model allows elements such as <TITLE> and <META>. The control model for the bold element <B> allows text and some other elements like </>. The content model for break element <BR> encloses no content so it is said to be empty. HTML start tag can sometimes contain attributes that modify the element's meaning. Attribute is separated from element by at least one space. Attributes indicate an effect by assigning values to their names.

Thus, a complete HTML element is defined by a start tag, an end tag if applicable,, possible attributes and a content model.

Html element
The HTML html tag is the container that contains all other HTML elements (except for the !DOCTYPE tag which is located before the opening html tag). All other HTML elements are nested between the opening <html> and </html> tags.
<html> <head> <title>HTML meta tag</title> </head> <body> Document content goes here </body> </html>

Example

Attributes specific to this tag: Attribute version content scheme Attributes: httpequiv Description Specifies the HTML DTD version of the document. The version attribute is deprecated - use the !doctype tag instead. Specifies the property's value. Specifies a scheme to use to interpret the property's value (as declared in the content attribute). Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include contenttype, expires, refresh and set-cookie. Other Attributes: Description Language code Specifies the direction of the text

Attribute lang dir

The HTML head tag is used for indicating the head section of the HTML document. The head can contain other HTML tags that provide information about the document such as title, description, keywords etc. Most of this information is not displayed in the browser (although the title usually appears in the browser's title bar) but can be useful for search engines etc. The head tag is placed between the <html> and the <body> tags.
<html> <head> <title>HTML head tag</title> </head> <body style="background-color:orange"> Document content goes here </body> </html>

Example

Attribute profile Attributes: Attribute lang dir

Attributes specific to this tag: Description Specifies the URI/URL of one or more meta data profiles. Other Attributes: Description Language code Specifies the direction of the text

The HTML body tag is used for indicating the main content section of the HTML document. The body tag is placed between the </head> and the </html> tags.
Note that the attributes for the body tag are deprecated in HTML 4.01 and obsolete in HTML 5. You should use CSS for defining the presentation of your document body. For example, see CSS backgroundcolor and CSS text-decoration.
<html> <head> <title>HTML body tag</title> </head> <body style="background-color:orange"> Document content goes here </body> </html>

Example

Attribute background text link vlink alink

Attribute class Attributes: id lang dir title

style bgcolor onload onunload onclick ondbclick onmousedown onmouseup

Attributes specific to this tag: Description Specifies the URI/URL of a background image. This attribute is now deprecated. Specifies the text color. This attribute is now deprecated. Specifies the color of unvisited hyperlink text. This attribute is now deprecated. Specifies the color of visited hyperlink text. This attribute is now deprecated. Specifies the color of active hyperlink text (i.e. when the user clicks on it). This attribute is now deprecated. Other Attributes: Description Document wide identifier. Document wide identifier Language code Specifies the direction of the text Specifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip"). Inline style (CSS) Background color. This attribute is now deprecated. Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers)

onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers) Intrinsic event (see event handlers)

You might also like