244
HTML HTML [Hyper Text Markup [Hyper Text Markup Language] Language]

HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Embed Size (px)

Citation preview

Page 1: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HTMLHTML[Hyper Text Markup Language][Hyper Text Markup Language]

Page 2: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HTMLHTML

Hypertext:It provides a way to create a link between information in the same document as well as in different documents.

Markup LanguageMarkup refers to the special tags that are a part of the HTML document. These tags specify how the document content should be displayed.

Page 3: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Structure of an HTML Structure of an HTML document.document.

Every HTML document should have the following structure:

A head : It is used to identify the head of a document. Many browsers don’t require this tag.

A body : The body of HTML document contains the text that will show up on the Web page. Moreover it contains pictures, links to other Web pages etc.

Page 4: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HTML TagsHTML Tags

Syntax:

<tag> </tag>

Moreover, tags are not case sensitive:

<tag> </tag>

<TAG> </TAG>

Both of the lines above means same thing.

Page 5: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<html> </html>

(or)

<HTML> </HTML>

Page 6: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Code Structure of HTML Code Structure of HTML DocumentDocument

<html><head>

</head>

<body>

</body></html>

Page 7: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<title> Tag<title> Tag

The <title> element in a document must occur within the <head> element of the document and is one of the only elements permitted to be in the head section.

<title> </title>

It gives title to your document.

Page 8: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<p> & <br> Tags<p> & <br> Tags

For a paragraph break we use tag <P> or <p>.

For a line break we use tag <BR>, <br> or <Br>.

Page 9: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<pre> Tag<pre> Tag

Pre stands for Preformatted. Sometimes you want to include spaces in your text and you don’t want your browser to ignore these spaces. Such spaces are included in the

<pre> </pre> tag.

Page 10: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<hn> Tage<hn> Tage

It is used to give headings. In the tag <hn> h stands for the heading where as n can be replaced with any number between 1-6. Where <h1> is the largest and <h6> is the smallest heading size.

<h1>MY PAGE</h1>

Page 11: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<hr> Tag<hr> Tag

<hr> stands for horizontal row.

Properties:SizeWidthColorNOSHADE

Page 12: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<B>, <<B>, <II>, & <U>>, & <U>

<b> </b> Bolds the data<I> </I> Italicizes the data<u> </u>Underlines the data

Page 13: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BGCOLORBGCOLOR

It gives background color to the body. It is a property of the body tag.

Example:

<body bgcolor=“red”>

</body>

Page 14: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

COLORSCOLORS

Colors can be given by their names like “green”, “blue”, “cyan” etc.

And also by their hexadecimal notations like 123ABC, 6789EF etc. One important thing to notice is that the color in hexa-decimal notations are also preceded by a ‘#’ sign.

Page 15: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples of bgcolorExamples of bgcolor

<body bgcolor=“red”> <body bgcolor=“#123ABC”>

Some basic colors are:

#FFFFFF ----- White

#000000 ----- Black

#FF0000 ----- Red

#00FF00 ----- Green

#0000FF ----- Blue

Page 16: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Text (color) PropertyText (color) Property

<body> tag has another property called “text.”

<body text=“red”>

Changes the color of the text, that appears on the page, to “red.”

Page 17: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Background propertyBackground property

<body> tag has another property called Background. This property helps us to give an image as a background of the page.

<body background=“sam.gif”>

Page 18: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BlockquoteBlockquote

The blockquote element is used to denote a long quotation – one that should be set off from the surrounding text in the document. Browsers typically display this type of quotation as indented text.

<blockquote> </blockquote>

Page 19: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Address TagAddress Tag

This element is used to hold addresses. Typically, it occurs at the end of documents and is used to enclose the author’s name and electronic mail address. Browsers usually display addresses in italic style.

<address> Sam Andrew<br>

[email protected] </address>

Page 20: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

center Tagcenter Tag

This allows text to appear in the center of page.

<center> I am centered </center>

Page 21: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Align PropertyAlign Property

With help of align property you can set text, pictures etc. to center, right or left.

<p align=“center”> This is centered text </p>

Page 22: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

TT tagTT tag

This tag is called monospace tag. It is called monospace because each letter in this typeface occupies exactly the same space. It typically looks like a typewriter font.

<tt> This is written using tt tag</tt>

Page 23: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Big TAGBig TAG

This tag increases the size of font.

<big> I am big </big>

<big> I am even bigger </big>

Size keeps on growing as you keep on adding the tag big.

Page 24: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Small TAGSmall TAG

This tag decreases the size of font.

<small> I am small </small>

<small><small>

I am even smaller

</small></small>

Size keeps on diminishing as you keep on adding the tag small.

Page 25: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

S or strike TAGS or strike TAG

s or strike tags is used to strike through the text.

<s> I am striked</s>

<strike> I am striked as well</strike>

Page 26: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

CITE TAGCITE TAG

This tag is use for citation. Browsers usually display citations in italics.

<cite> I am cited </cite>

Page 27: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Code TAGCode TAG

We use this tag while displaying programs on internet. Browsers usually display this text in a fixed-width font.

<code>

A=34;<br>

System.out.println(“A=” + A);

</code>

Page 28: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

DFN TAGDFN TAG

Use to specify definitions.

HTML:

<dfn>

HyperText Markup Language

</dfn>

Page 29: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

DEL TAGDEL TAG

Its output is similar to that of <s> or <strike>. It displays your information in deleted text.

<del> I am fine. </del>

Page 30: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<EM> TAG<EM> TAG

Used to denote emphasis of the affected text. Browsers usually display emphasis as italics.

<EM> I am italicized </EM>

Page 31: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<STRONG> TAG<STRONG> TAG

Used to denote strong or important text. Browsers usually display display it in bold font.

<strong> I am bold </strong>

Page 32: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<INS> Tag<INS> Tag

Browsers usually display it as an underline text.

<ins> I am underlined </ins>

Page 33: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<SUB> & <SUP> Tag<SUB> & <SUP> Tag

<SUB> displays your information in subscript.

H<SUB>2</SUB>

<SUP> displays your information in superscript.

H<SUP>2</SUP>

Page 34: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Font TAGFont TAG

Font tag is used to set the following font properties:

SizeColorFace

Page 35: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BASEFONT TAGBASEFONT TAG

Unfortunately, BASEFONT was not named BASEFONTSIZE because what it does is to set the default font size. I.E. 2.0 and above supports same attributes for BASEFONT as for FONT. Default font-size value is 3.

<basefont size=7> My size = 7 </basefont>

Page 36: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Special CharactersSpecial Characters

In order to display some special characters on your web page we use & sign.

Example: To show copyright symbol we use:

&copy;And many more…They always end with (;) symbol.

Page 37: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

LISTSLISTS

Definition ListsOrdered ListsUnordered ListsOther Approaches

Page 38: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Definition ListsDefinition Lists

Definition List includes the following terms:

<DT> means definition term<DD> means Definition description<DL> Definition List

Page 39: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<DL>

<DT>HTML:

<DD>HyperText Markup Language.

<DT>XML:

<DD>Extensible Markup Language.

<DT>DHTML:

<DD>Dynamic HyperText Markup Language.

</DL>

Page 40: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Unordered ListUnordered List

Unordered List includes the following terms:

<UL> means unordered list.<LI> means list.

Page 41: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<UL>

<LI>HTML

<LI>DHTML

<LI>XML

<LI>SGML

</UL>

Page 42: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Unordered List 3Unordered List 3

Unordered list have an option called “type.” With the help of this option you can change the appearance of the bullets that appear on your screen. Following are the types of bullets available in UL.

CircleDiscSquare

Page 43: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExamplesExamples

<ul type=“circle”>

<ul type=“disc”>

<ul type=“square”>

Page 44: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Ordered ListOrdered List

Ordered Lists includes the following:<OL> means ordered list<LI> means list

Page 45: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<OL>

<LI>HTML

<LI>DHTML

<LI>XML

<LI>SGML

</OL>

Page 46: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Ordered List 3Ordered List 3

Ordered list have an option called “type.” With the help of this option you can change the appearance of the bullets that appear on your screen. Following are the types of bullets available in OL.

1 Arabic Numerals A Uppercase Letters a Lowercase Letters I Large Roman i Small Romans

Page 47: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Ordered List 4Ordered List 4

Apart from type we also have an option called “start.” Start tells HTML what will be the initial value where as type tells HTML what kind of bullet I want to use.

Page 48: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

EXAMPLE:

<OL TYPE=1 START=9>

<OL TYPE=a START=9>

<OL TYPE=A START=9>

<OL TYPE=I START=9>

<OL TYPE=i START=9>

Page 49: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Other ApproachesOther Approaches

There are two more methods to achieve unordered list format:

<DIR><MENU>

There is no difference in the output.

Page 50: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

MENU TAG EXAMPLEMENU TAG EXAMPLE

<menu>

<LI>HTML

<LI>DHTML

<LI>XML

<LI>SGML

</menu>

Page 51: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

DIR TAG EXAMPLEDIR TAG EXAMPLE

<dir>

<LI>HTML

<LI>DHTML

<LI>XML

<LI>SGML

</dir>

Page 52: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Nested ListsNested Lists<ol>

<li> Paste Tomatoes <li>

<ul>

<li> Banana Legs </li>

<li> Principle Borghese </li>

</ul>

<li> Cherry Tomatoes </li>

<ul>

<li>Gold Nugget</li>

<li>Small Fry</li>

</ul></ol>

Page 53: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<ul>

<li>Level One

<ul>

<li>Level Two

<ul>

<li>Level Three

</ul>

</ul>

</ul>

Page 54: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ImagesImages

Adding images to a web page improves its environment. Images are part of multimedia. Following are some of the widely used image extensions. Images are viewed according to the extension they carry:

Page 55: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Description Extension

GIF image .gif

JPEG image .jpg (or) .jpeg

Progressive JPEG image

.pjpg

Portable network graphic

.png

Computer Graphics Metafile

.cmg

Windows Bitmap image

.bmp

PICT image .pict

Adobe Acrobat File .pdf

Page 56: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Description Extension

Encapsulated PostScript

.eps

PostScript File .ps

TIFF Image .tiff

XBM bitmap image .xbm

Page 57: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Choosing an Image FormatChoosing an Image Format

However, most browsers have built-in or “inline” support for only one or two formats. While most browsers may be configured to support additional formats.

There are two methods that browsers may use to support image format that do not have built-in inline support.

Page 58: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Method – 1Method – 1

The older method uses an external program to display the image. With this method the image does not appear in the browser window; instead the browser runs the viewer program, and the image is displayed in the viewer program’s window, rather than in the browser.

Page 59: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Method - 2Method - 2

The newer method employs the use of plug-ins or Active-X controls.

Page 60: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Method – 2.2Method – 2.2

Plug-ins:

A plug-in is a module that the browser uses to add extra functionality to its native capabilities. Since plug-ins are not part of the browsers they need to be install before using. Once they are installed the browsers can display images that are stored in that format.

Page 61: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Method – 2.3Method – 2.3

Active-X control:

They provide similar functionality as plug-ins but unlike plug-ins they are automatically downloaded and installed.

Page 62: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

AdviceAdvice

Since you cannot count on your readers to configure their browsers to support additional image formats, it is advisable to choose one of the widely supported formats for your images.

Page 63: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Most common FormatsMost common Formats

Two most common formats are:GIFJPEG

If you already have images but in other format try converting them to any of these two formats.

Page 64: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

GIFGIF

GIF stands for Graphics Interchange Format. It was developed by CompuServe. GIF images are limited to 256 colors, making it poor choice for photographic images

Page 65: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Interlaced GIFInterlaced GIF

These images are images in which the scan lines have been rearranged so that a low-resolution version image can quickly be displayed. The rest of the image is then filled in over several passes. Although storing images in this format does not speed up transmission time. It rather takes slightly more space than regular GIF file.

Page 66: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Interlaced GIF 2Interlaced GIF 2

What it does is that it provides readers with a quick preview of the final image and helps to provide the impression that your document has loaded quickly.

Remember that all browsers don’t take help from this feature. It just makes pictures available to readers fast.

Page 67: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

JPEGJPEG

JPEG stands for Joint Photographic Experts Group, which is the group that originally developed this standard. A related standard called “MPEG” is used for video.

Page 68: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

JPEG TechnologyJPEG Technology

It stores information about the image by keeping track of the color changes in the image rather than storing information about each pixel in the image. It is known as the lossy format because final image is not exactly same as the original. However the human eye does not usually perceive the tiny differences introduced by this format.

Page 69: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Advantage of JPEGAdvantage of JPEG

For certain types of images JPEG requires much less storage space than do equivalent GIF. Hence requires less transmission time.

Page 70: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Compression UtilityCompression Utility

JPEG offers several levels of compression.. Highly compressed images require less space and less time to transfer. The drawback is that they must be uncompressed on the other hand which requires additional time.

Page 71: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

GIF vs JPEGGIF vs JPEG

Originally GIF formatted images had the widest support. However, almost all browsers with exception of older versions support JPEG images. For graphics such as logos or line drawing, GIF will almost always produce sharper results. And may even require less storage. Photographs and other complex images must be should be stored in JPEG format.

Page 72: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Progressive JPEGProgressive JPEG

It offers the advantages of interlaced GIF images accompanied by the low storage requirements of the JPEG format.

Page 73: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ThumbnailsThumbnails

A thumbnails copy of an image is a small version that your users can use to decide whether they want to get the full-size version.

Page 74: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image TagImage Tag

We use <img> tag to display images on web pages/sites. <img> tag has following properties:

SrcWidthHeightAltAlign

Page 75: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image Tag 2Image Tag 2

HspaceVspaceBorder

Page 76: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<img> SRC Property<img> SRC Property

We already know that IMG stands for "image.” Src stands for “source.” It is a reference to the location of the image file.

If the image is in the same directory as the file you will write:

<img src=pic1.gif>

And if it is in some other directory then you

Page 77: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<img> SRC Property 2<img> SRC Property 2

And if it is in some other directory then you

may have to give the full path name.

<img src=“c:\windows\sun.gif”>

(or)

<img src=http://www.so.com/bk/s1.gif>

Page 78: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Labeling an ImageLabeling an Image

For Labeling an image we use “ALT” property. The ALT stands for alternate text because this message will appear in place of the image in older Web browsers that don't display graphics.

Page 79: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

A note for the Browsers UsersA note for the Browsers Users

The message you put in the ALT attribute will be seen by some people who are using the latest Web browser software, too. Many people--especially those with slow modems--turn off the Auto Load Images option in Netscape Navigator and Show Picture option in I.E., so they can see the text on Web pages without wasting time downloading images they don't care about.

Page 80: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Use of ALT propertyUse of ALT property

This is how we use this property:

<img alt=“My picture one” src=pic1.gif>

In order to view how it looks on text-browsers type:

<img alt="my picture">

Page 81: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image AlignmentImage Alignment

Images on web pages can be aligned:LeftRightCenter

By default images are aligned left. Therefore it is not necessary to write align=“left”

Page 82: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image Alignment ExampleImage Alignment Example

By default:

<img src=pic1.gif>

Right align:

<img src=pic1.gif align=“right”>

Center align:

<img src=pic1.gif align=“center”>

Page 83: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HSpace PropertyHSpace Property

This property allows image to give some horizontal spacing:

<img src=“pic1.jpg” hspace=40>

Page 84: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

VSpace PropertyVSpace Property

This property allows image to give some horizontal spacing:

<img src=“pic1.jpg” VSpace=40>

Page 85: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

LinkingLinking

The link markup tag in HTML is <a>. <a> stands for anchor. This is followed by the URL of the destination document. Then the content or name of the hyperlink is entered. The closing anchor tag is of course </a>

The whole statement appears like this:

<a href=“prg1.html”>Program Number 1</a>

Page 86: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking 2Linking 2

<a href=“prg1.html”>Program Number 1</a>

In the line above <a> and </a> are opening and closing tags. href stands for hypertext reference which basically followed by the name of the file which has to be opened. “Program Number 1” is the text that appears on your web page. Clicking this text wiil take you to “prg1.html.”

Page 87: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Title propertyTitle property

This attribute or property is used to give additional information about link. When you brink your mouse near link it open a box with the message that works as an online help for the user.Example:<a href="sam.html" title="This will take you to Sam.">Web Site of Sam</a>

Page 88: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Target AttributeTarget Attribute

Lets say you have a link on your web page and you want it work like this: “When the link is clicked, it must open the requested page in another window instead of the same one.” Then answer to your problem is target.

Page 89: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Target Attribute ContinuesTarget Attribute Continues

Example:

<a href=“pg1.html” target=“newin”>ME</a>

In the example above, page “pg1” will open in another window named “newin,” instead of the same window as your web page is in.

Page 90: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Using Pictures in LinksUsing Pictures in Links

If you want to use pictures instead of text as links, then the answer is:

<a href=“me.html”> <img src=s1.gif></a>If you want to use both text as well as picture then the answer to your problem is:<a href=“me.html”> Click Here<img src=s1.gif></a>

Page 91: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

alink, vlink & linkalink, vlink & link

These are three more attributes that can be added to your body tag:

<body alink=“red” vlink=“green” link=“blue”><body alink=“red” vlink=“green” link=“blue”>

Link set colors for links that have not yet been visited.

vlink set the colors for links that have been visited.

alinkset the colors for links that are active i.e. which are in the process of being loaded.

Page 92: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

*BGProperties*BGProperties

Another property for body tag is Bgproperties. It is a non-standard property and works only in I.E. It is used to prevent the background from scrolling. It takes a single value: “fixed.” Example:Example:

<body background="picture.jpg" bgproperties="fixed“>

Page 93: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Intra Page LinksIntra Page Links

This method allows you to jump around at different places on the same page. Instead of linking to other pages the page is linked to itself.

Page 94: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Intra Page Links 2Intra Page Links 2

Regular links are written as:

<a href=“mp.html”>My page</a>

The destination link is present in one page and the original page is at another location.

In intra Page links, both things are present in the same page.

Page 95: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Intra Page Links 3Intra Page Links 3

Links are included in the following way:

1. < a href=“#place1”>Go There</a>

2. < a name=“place1”></a>

First statement represents link and second statement represents the location of the link. Lets look at the following example:

Page 96: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<a href=“#mypplace”>Click here to go to my place</a>

.

.

.

.

.

<a name=“myplace”></a> So finally you have reached. I was waiting for you. I was worried about you. I am glad you reached safely.

When you click on “Click here to go to my place” it will take you to the When you click on “Click here to go to my place” it will take you to the location where its says, “myplace.” location where its says, “myplace.”

Page 97: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking to Specific part of Linking to Specific part of another Web Pageanother Web Page

This feature allows you to connect from one web page to a specific part of another web page.

Follow the instructions below to understand this concept practically:

Page 98: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

Create a web page with the following contents:

<html><body><A HREF="prog2.html#two">II. The President</A></body></html>Save the program above as prog1.html

Page 99: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example ContinuesExample Continues

Now create another page and write the following things to the page:

<html>

<body>

<a name=#two></a>Hi! how are you???

</body>

</html>

Save this program as prog2.html

Run prog1.Click on the link; it will take you to “two” in prog2.

Page 100: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking Your Email addressLinking Your Email address

In order to link your email address follow these steps:

<A HREF="mailto:[email protected]"> Send me an e-mail message.</A>

Page 101: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

MarqueeMarquee

Marquee is a horizontally scrolling text. Its direction can be changed though but by default it scrolls horizontally.

<marquee> is the opening tag.

</marquee> is the closing tag.

Page 102: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Marquee 2Marquee 2

Marquee has the following properties: Direction Behavior BgColor ScrollAmount Width Height Loop

Page 103: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BGColorBGColor

It gives background color to your marquee.

Example:

<marquee bgcolor=“red”>Hello!</marquee>

Page 104: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HeightHeight

It can be used to set height of marquee.

<marquee bgcolor=“red” height=100>

Or

<marquee bgcolor=“red” height=60%>

Page 105: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

WidthWidth

It can be used to set width of marquee.

<marquee bgcolor=“red” width=100>

Or

<marquee bgcolor=“red” width=40%>

Page 106: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ScrollAmountScrollAmount

Using this property you can set the scroll speed of marquee.

<marquee bgcolor=“red” scrollamount=200>

Hello

</marquee>

Page 107: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BehaviorBehavior

There are three behaviors that a marquee observes:

Scroll [ by default behavior]Slide [ slides only once ]Alternate [ gives bouncing effect to text ]

Page 108: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

DirectionDirection

Marquee can move in four possible directions:

Left [by default]RightUpDown

Page 109: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example of DirectionExample of Direction

For example: <marquee

direction=“right”>Hello!!!</marquee>

Page 110: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

LoopLoop

It can help you set the number of times you would like the marquee to move.

<marquee loop=2>Hello</marquee>

Page 111: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

AppletApplet

If you like to add an applet to your HTML page:

<applet code=“program1.class” height=100Width=100></applet>

Page 112: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Comments in HTMLComments in HTML

Comments are given as follows:

<!--This is a comment -->

Or

<comment>This is a comment.</comment>

Page 113: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

MoviesMovies

To include a movie you have to upload the movie file on your web server and has to provide a link to it.

<a href=“movie.avi”> J. Kennedy </a>

Page 114: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

SoundsSoundsDescription Extension

AIFF sound .aiff

LAW sound .au

MIDI sound file .mid

RealAudio .ra or .ram

WAV sound file .wav

Page 115: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BGsoundBGsound

You can also set a back ground sound for your web page.

Bgsound has following properties:SrcLoop

Page 116: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

SrcSrc

Here you provide with the name of the source file:

<bgsound src=“mjackson.wav”>

Page 117: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

LoopLoop

I controls the number of times sound will be played.

<bgsound src=“amitc.wav” loop=2>

(or)<bgsound src=“amitc.wav” loop=infinite>

Page 118: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image MapImage Map

You can also subdivide an image into regions that link to different documents, depending on where someone clicks. This is called an image map, and any image can be made into an image map.

Page 119: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image Map 2Image Map 2

To make any type of image map, you'll need to figure out the numerical pixel coordinates of each region within the image that you want to be a clickable link.

Page 120: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example:Example:

<map name=“heads”><area shape=“rect” coords=“40,20,130,40”href=“james.html”><area shape=“rect” coords=“50,100,34,120”Href=“john.html”></map><img src=“friends.jpg” width=200 height=100

usemap=“#heads””>

Page 121: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExplanationExplanation

SHAPE="RECT" indicates that the region is rectangular.

COORDS="40,10,130,130" gives the top-left and bottom-right corner coordinates for the rectangular region.

HREF=“james.html" specifies the page that clicking on the region will link to. You can use any address or filename that you would use in an ordinary <A HREF> link tag.

Page 122: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example for other shapesExample for other shapes

<area shape=“poly" coords=“3,60,4,10,130,130" href="james.html">

<area shape=“circle" coords="4,10,10" href="james.html">

Page 123: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

TablesTables

One of the most powerful tools for creative Web page design is the table, which allows you to arrange text and images into multiple columns and rows. To make tables, you have to start with a <TABLE> tag. Of course, you end your tables with the </TABLE> tag.

Page 124: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Properties of Table 1Properties of Table 1

Properties:BorderBgcolorWidthHeightCellpaddingCellspacing

Page 125: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Properties of Table 2Properties of Table 2

BorderColorBorderColorDarkBorderColorLightFrameRulesAlign

Page 126: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<table><table>

Table consists of:<th> heading<tr> row<td> cell

Page 127: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example – I [table]Example – I [table]

<table>

<tr>

<td>Green</td>

<td>Blue</td>

</tr>

</table>

Page 128: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example – II [table]Example – II [table]

<table>

<tr>

<td>Green</td><td>Blue</td>

</tr>

<tr>

<td>Black</td><td>Red</td>

</tr>

</table>

Page 129: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<caption><caption>

This tag is used to give heading to a table.

<table>

<caption>Colors</caption>

<tr>

<td>red</td><td>blue</td>

</tr>

</table>

Page 130: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Border propertyBorder property

This property gives border to table.

<table border=5>

<caption>Authors</caption>

<tr>

<td>Dickens</td><td>Shakespeare</td>

</tr>

</table>

Page 131: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BgColor PropertyBgColor Property

<table border=5 bgcolor=“red”>

<caption>Cars</caption>

<tr>

<td>Honda</td><td>Ford</td>

</tr>

</table>

Page 132: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Width and Height 1Width and Height 1

Ordinarily, the size of a table and the size of its individual cells automatically expand to fit the data you place into it. However, you can choose to control the exact size of the entire table by putting WIDTH and/or HEIGHT attributes in the <TABLE> tag.

Page 133: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Width and Height 2Width and Height 2

You can also control the size of each cell by putting WIDTH and HEIGHT attributes in the individual <TD> tags. The WIDTH and HEIGHT can be specified as either pixels or percentages.

Page 134: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Width and Height 3Width and Height 3

For example, the following HTML makes a table 500 pixels wide and 400 pixels high: <TABLE WIDTH=500 HEIGHT=400> To make the first cell of the table 20 percent of the total table width, and the second cell 80 percent of the table width, you would type:

<TABLE><TR><TD WIDTH=20%>Skinny cell</TD> <TD WIDTH=80%>Fat cell</TD>

</TR></TABLE>

Page 135: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<TABLE WIDTH=500 HEIGHT=400> <caption>Computers</caption><tr>

<td>HP</td><td>GateWay</td>

</tr>

</table>

Page 136: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

AlignAlign

<table border=2 align=center><tr><td>Hi</td><td>Hola</td></tr></table>

(or)<table border=2 align=right><tr><td>Hi</td><td>Hola</td></tr></table>

Page 137: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BorderColorBorderColor

We can also set colors of borders.<table bordercolor=“red”><tr><td>How are you?</tr></table>

Page 138: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

BorderColorLight BorderColorLight & BorderColorDark& BorderColorDark

These properties are used to give a 3-D effect to your table. They are supported only by I.E.

Page 139: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<table bordercolorlight=“red” bordercolorlight=“green” bordercolor=“blue”>

<tr><td>How are you?</td></tr></table>

Page 140: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

CellPaddingCellPadding

Spacing Between the edge of a cell and the cell’s contents.

< table cellpadding=5><tr><td>Sam</td><td>Mark</td></tr><tr><td>Saad</td><td>Asad</td></tr>

</table>

Page 141: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

CellSpacingCellSpacing

Amount of space between the edge of a cell and the edge of the table and other cells.

< table cellspacing=5><tr><td>Sam</td><td>Mark</td></tr><tr><td>Saad</td><td>Asad</td></tr>

</table>

Page 142: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frame Properties 1Frame Properties 1

Frame property can be assigned any of the following values:

Void---No sides.Above---Top side only.Below---Bottom side onlyHsides---Horizontal sides onlyVsides---Vertical sides only

Page 143: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frame Properties 2Frame Properties 2

LHS---Left Hand Side only.RHS ---Right Hand Side only.

Page 144: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

RulesRules

Void---no linesRows---only between rowsCols---only between columnsAll---between all rows and columns

Page 145: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<table border=3 rules=void> </table><table border=3 rules=cols> </table><table border=3 rules=rows> </table><table border=3 rules=all> </table>

Page 146: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<th><th>

<table border=2><tr><th>Food</th><th>Drink</th></tr><tr><td>A</td><td>B</td></tr><tr><td>C</td><td>D</td></tr></table>

Page 147: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Group of RowsGroup of Rows

<thead> ... </thead> - Table Header <tbody> ... </tbody> - Table Body

<table border> <thead> <tr><th>Food</th><th>Drink</th>

<th>Sweet</th> </thead> <tbody> <tr><td>A</td><td>B</td><td>C</td> <tr><td>D</td><td>E</td><td>F</td> </tbody> </table>

Page 148: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ColSpan & RowspanColSpan & Rowspan

The number of columns spanned by the cell is called colspan and number of rows spanned by a cell is called rowspan.

Page 149: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<table border=2>

<caption>A very silly Table</caption>

<tr>

<th>column one</th><th>column two</th>

<th>column three</th><th>column four </th>

</tr>

<tr align=center>

<td>A plain cell</td><td colspan=2>

I am here</td><td>Hi!</td></tr>

Page 150: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<tr>

<td colspan=2>This cell spans two columns</td>

<td align=right colspan=2> I am right justified </td> </tr>

<tr><td rowspan=2>This cell spans two rows</td>

<td>A</td><td>B</td><td>C</td></tr>

<tr align=right><td>Right-Justified row </td> <td>E</td><td>F</td>

</tr>

</table>

Page 151: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Some Table Examples Some Table Examples

Calendar Example.

Others

Page 152: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<meta><meta>

The meta element belongs in the head portion of a document. Meta allows you to provide meta-information about your document. Some of its uses include providing additional indexing information and extra document control information such as expiration dates etc. Meta tag is used to provide information about information.

Page 153: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<meta> Attributes<meta> Attributes

Meta tag has three attributes.

1.HTTP-EQUIV

2.Name

3.Content

Page 154: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

HTTP-EQUIVHTTP-EQUIV

HTTP is used by Web Servers to send HTML documents on the internet. This attribute is used to specify one of the predefined HTTP response headers. Names of these headers are not case sensitive. Example: Reply-to, Refresh, Expires, Keywords etc.

Page 155: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

NameName

Meta information name. Assumed equal to the value of HTTP-EQUIV if not set explicitly. Examples: Author, Description, Keywords etc.

Page 156: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ContentContent

Used to set information content to be associated with the given name and/or HTTP response header.

Page 157: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples:Examples:

<meta name=“author” content=“Greta,Gardener” ><meta name=“copyright” content=“Greta Gardener, 1998” ><meta name=“Keywords” content=“oranges, apples,mango” ><meta name=“Resource-Type” content=“Document” >

Page 158: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Forcing Document ReloadForcing Document Reload

<meta http-equiv=“Expires” content=“wed, 10 Apr 1998 00:00:00 –0000”>

With some browsers it will force the document to be reloaded from server rather than read from cache. Browsers who understand this tag will check the time and should not cache the page at all.

Page 159: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Automatic Document RefreshAutomatic Document Refresh

<meta http-equiv=“Refresh” content=“1”>

Clients request data from servers. If content property is set to an integer, the browser will wait that number of seconds before reloading the current document.

Page 160: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<html>

<head>

<meta http-equiv=“Page-Enter” content=“revealTrans(Duration=7.0, Transition=30)”>

<meta http-equiv=“Page-Exit” content=“revealTrans(Duration=7.0, Transition=30)”>

</head>

<body>

Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br> Your text goes here<br>

</body></html>

Page 161: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

TransitionsTransitions

Transition=n, where n is equal to any integer form 1-22.

Any integer entered for n greater than 22 will randomly cycle through the 22 available transitions each time the page loads.

Page 162: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

FramesFrames

One major limitation of HTML in the old days was that you could see only one page at a time. Frames overcome this limitation by dividing the browser window into multiple HTML documents. Like tables, frames allow you to arrange text and graphics into rows and columns of text and graphics.

Transition=n, where n is an integer, 1-22. Any integer 23 or greater randomly cycles through

Transitions 1 through 22

Page 163: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frames 2Frames 2

However, unlike a table cell, any frame can contain links that change the contents of other frames (or itself). Frames are basically a way of arranging and presenting several Web pages at once.

Frames are only supported by Netscape Navigator version 2.0 or higher and Microsoft Internet Explorer version 3.0 or higher.

Page 164: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frames 3Frames 3

In short, a frame is a rectangular region within the browser window that displays a Web page, alongside other pages in other frames.

Page 165: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

How to use FramesHow to use Frames

First create the contents of each frame as an ordinary HTML page.

To put them all together, use a special kind of page called a frameset document.

Page 166: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

FramesetFrameset

A frameset document actually has no content. It only tells the browser which pages to load, and how to arrange them in the browser window.

Page 167: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

NoteNote

In an HTML document you will see that instead of a <BODY> tag, there is a <FRAMESET> tag. No tags that would normally be contained in a <BODY> tag can be within the <FRAMESET> tag.

Page 168: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

FrameSet 3FrameSet 3

The <FRAMESET> tag includes a ROWS attribute, meaning that the frames should be arranged on top of each other like the horizontal rows of a table. If you want your frames to be side-by-side, use a COLS attribute instead of ROWS.

Page 169: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frameset 4Frameset 4

<FRAMESET ROWS="80,*,80">

means to split the window horizontally into three frames.

<FRAMESET COLS="80,*,80">

means to split the window vertically into three frames.

Page 170: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Frameset – rows/cols sizeFrameset – rows/cols size

You must specify the sizes of the ROWS or COLS, either as precise pixel values or as percentages of the total size of the browser window. You can also use an asterisk (*) to indicate that a frame should fill whatever space is available in the window.

Page 171: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

<frame> tag<frame> tag

Within the <FRAMESET> and </FRAMESET> tags, you should have a <FRAME> tag indicating which HTML document to display in each frame. (If you have fewer <FRAME> tags than the number of frames defined in the <FRAMESET> tag, any remaining frames will be left blank.) You don't need to specify a closing </FRAME> tag.

Page 172: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Src propertySrc property

Include a SRC attribute in each <FRAME> tag, with the address of the Web page to load in that frame

You can include any HTML page you want in a frame

Page 173: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example - IExample - I

<FRAMESET COLS="80,*,80">

<frame src=“pg1.html">

<frame src=“pg2.html">

<frame src=“pg3.html">

</frameset>

Page 174: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example - IIExample - II

<FRAMESET COLS=“20%,50%,30%">

<frame src=“pg1.html">

<frame src=“pg2.html">

<frame src=“pg3.html">

</frameset>

Page 175: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example - IIIExample - III

<FRAMESET COLS=“*,*,*">

<frame src=“pg1.html">

<frame src=“pg2.html">

<frame src=“pg3.html">

</frameset>

Page 176: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking Between the Frame Linking Between the Frame WindowsWindows

The real fun begins when you give a frame a name with the <FRAME NAME> attribute. You can then make any link on the page change the contents of that frame using the <A TARGET> attribute.

Page 177: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking Between the Frame Linking Between the Frame Windows 2Windows 2

<FRAME SRC="main.html" NAME="main"> This displays the main.html page in that frame when the page loads, and names the frame "main."

Page 178: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Linking Between the Frame Linking Between the Frame Windows 3Windows 3

<A HREF="makeit.html" TARGET="main">See us make it.</A>Include this line in one of the pages being displayed in frameset. When you will click on the link above, makeit.html will be displayed in the frame name “main.”

Page 179: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example p1Example p1

<frameset cols="20%,*">

<frame src="index.html">

<frame src="page1.html" name="main">

</frameset>

Page 180: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example p2Example p2

<html>

<body>

<a href="page1.html" target="main">Page1</a><p>

<a href="page2.html" target="main">Page2</a><p>

<a href="s3.html" target="main">Page3</a><p>

<a href="s4.html" target="main">Page4</a><p>

</body>

</html>

Page 181: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Margins, Borders, and Margins, Borders, and ScrollingScrolling

In addition to the NAME attribute, the <FRAME> tag can take the following special frame-related attributes:

MARGINWIDTH: Left and right margins of the frame (in pixels)

MARGINHEIGHT: Top and bottom margins of the frame (in pixels)

SCROLLING: Display scrollbar for the frame? ("yes" or "no")

NORESIZE: Don't allow this frame to be resized by the user

Page 182: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ScrollingScrolling

Normally, any frame that isn't big enough to hold all of its contents will have its own scrollbar(s). If you don't want a particular frame to ever display scrollbars, you can put SCROLLING=NO in the frame tag. Conversely, SCROLLING=YES forces both horizontal and vertical scrollbars to appear, whether or not they are needed.

Page 183: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ResizeResize

People viewing your frames can ordinarily resize them by grabbing the frame border with the mouse and dragging it around. If you don't want anyone messing with the size of a frame, put NORESIZE in the <FRAME> tag.

Page 184: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

No BordersNo Borders

If you want borderless frames to show up in browser, type BORDER=0 in your <FRAMESET> tag .

Page 185: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

MarginMargin

MARGINWIDTH and MARGINHEIGHT are pretty self-explanatory. They are used to set the margin width and margin height.

Marginheight=num of pixels

Marginwidth=num of pixels

Page 186: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<FRAMESET COLS="*,*,40%” border=0>

<frame src=“pg1.html" name="main" scrolling="yes" noresize marginheight=10 marginwidth=10>

<frame src=“pg2.html">

<frame src=“pg3.html">

</frameset>

Page 187: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Nested FramesNested Frames

By nesting one <FRAMESET> within another, you can create rather complex frame layouts.

Page 188: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

EXAMPLE:<FRAMESET COLS="*,*,*" border=0>

<frame src="ss.html" name="main" scrolling="no" noresize marginheight=10 marginwidth=10>

<frameset rows="*,*">

<frame src="prog1.html">

<frame src="prog2.html">

</frameset>

<frame src="s2.html">

</frameset>

Page 189: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Supporting Frameless Supporting Frameless BrowsersBrowsers

We use <noframe> tag to show text to the browsers who do not show frames. Example:

<noframe><body>I think your browser does not supports frame.</body></noframe>

This message does not appear to those users whose browsers support frames.

Page 190: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

Do one frame Example by yourself.

Page 191: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

IFRAMEIFRAME

It allows a frame to be embedded in a regular HTML document. Unlike a document that contains a FRAMESET, documents with IFRAME elements follow the standard HTML document structure.

Page 192: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

IFRAME 2…IFRAME 2…

An IFRAME element looks like this:

<iframe src=“tomato.html”>

What ever you write here is displayed to those whose browsers don’t support iframes.

</iframe>

Page 193: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

PropertiesProperties

Align = LEFT | RIGHT | CENTERFrameBorder (NO | YES | 0 | 1)Height = n <Where n is amount in pixels>Width= n <Where n is amount in pixels>HSPACE= n <Where n is amount in pixels>VSPACE= n <Where n is amount in pixels>

Page 194: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Properties 2…Properties 2…

MARGINHEIGHT= n <Where n is amount in pixels>

MARGINWIDTH= n <Where n is amount in pixels>

SCROLLING = AUTO | YES | NOSRC

Page 195: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Property Descriptions Property Descriptions Follow…Follow…

Page 196: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Property

Name

Property Description

ALIGN Frame Alignment. It can have any of these three values: (left, right, or center)

FrameBorder Determines whether a border is drawn around frame. It can have any of these values: (0 , No, 1, Yes).

HEIGHT The Height of the Space Reserve for the frame. The value may be provided in pixels or %.

Page 197: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Property

Name

Property Description

WIDTH Width of the Space Reserve for the frame. The value may be provided in pixels or %.

HSPACE The horizontal margin for the frame in pixels.

VSPACE The vertical margin for the frame in pixels.

SRC URL of the document to be included in the frame.

SCROLLING Includes a Scrollbar with the frame.

Page 198: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Property

Name

Property Description

MARGINWIDTH The width of left and right margins in pixels.

MARGINHEIGHT The height of left and right margins in pixels.

Page 199: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

EXAMPLE IFRAMEEXAMPLE IFRAME<html> <body>

This page includes an IFRAME.<p>

<center> <iframe src="prog2.html">

If you can see me, then you can’t see iframe.

</iframe> </center>

<p> Did you like this new concept?

</body> </html>

Page 200: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Creating HTML FormsCreating HTML Forms

HTML is a two-way street; you can use your Web pages to gather information from the people who read them as well. Web forms allow you to receive feedback, orders, or other information from the readers of your Web pages. If you've ever used a Web search engine such as Lycos or Excite, you're familiar with HTML forms. Product order forms are also an extremely popular use of forms.

Page 201: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

How Form WorksHow Form Works

Before you learn the HTML tags to make your own forms, you should understand how the information that someone fills out on a form makes its way back to you. You also need to have the person who runs your Web server computer set it up to process your forms. Every form must include a button for the user to submit the form. When someone clicks on this button, all the information they have filled in is sent (in a standard format) to an Internet address that you will specify in the form itself.

Page 202: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

How Form Works 2How Form Works 2

Almost all Internet service provider companies that offer Web page hosting also provide pre-programmed scripts to their customers for processing forms. The most common thing that such a script would do is forward the information from the form to your e-mail address, though it might also save the information to a file on the Web server or format the form data to make it easier for you to read.

Page 203: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Form tagForm tag

Every form must begin with a <FORM> tag, which can be located anywhere in the body of the HTML document.

Page 204: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Form ObjectsForm Objects

Form has the following objects:

1. Text

2. CheckBox

3. ListBox

4. Button

5. RadioButton

6. Image

7. TextArea

Page 205: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Form Input: INPUTForm Input: INPUT

The input element should be used only with in the form element and is denoted by <input>. It specifies the kind of input field presented to the user. These fields must use the name attribute so that they can be referenced from anywhere within or outside the program. The value property tells us about the value that a particular object holds.

Page 206: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Properties 1Properties 1

NameMaxlengthSizeSrcValueTypechecked

Page 207: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Properties 2Properties 2

disabledreadonlyalign

Page 208: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Type AttributeType Attribute

It is used to specify the type of data used in an input field. The other attributes that are applicable to a particular field depend on the field’s TYPE attribute.

Page 209: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Text TypeText Type

This specifies a single line text entry field; it can be used in conjunction with the maxlength and size attributes.

Examples:

<input type=text name=“text1” maxlength=10

Size=5>

Page 210: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example:Example:

<p>What's your first name? <INPUT TYPE="text" SIZE=20 MAXLENGTH=30 NAME="firstname"> What's your last name? <p><INPUT TYPE="text" SIZE=20 MAXLENGTH=30 NAME="lastname">

Page 211: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Text TypeText Type

The TYPE attribute indicates what type of form element to display, a simple one-line text entry box in this case. The SIZE attribute indicates approximately how many characters wide the text input box should be. MAXLENGTH determines the number of characters the user is allowed to type into the text box.

Page 212: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Password TypePassword Type

Password is the same as text, except the text entered by the user is obscured. Like text you can use the size and maxlength attributes with this field.

<p>Please Enter your Password:

<input type=password name=“pass” maxlength=15 size=10>

Page 213: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Button Input TypeButton Input Type

The button type creates a button. The action associated with a button field must be defined through scripting and onClick event. e.g.

<p> Click Here: <input type=button name=“b1” value=“Click”><p>

Click Here: <input type=button name=“b2”>

Page 214: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Submit & ResetSubmit & Reset

The submit button is used to submit form’s content where as reset is used to set all the fields in the form to their initial value.

<p> <input type=“submit”>

<p> <input type=“reset”>

Page 215: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Image TypeImage Type

If you do not like the look of the plain button used with SUBMIT, you may use the IMAGE type along with an image as an alternative to submit. The image type defines an image field that can be clicked on by the user with a pointing device causing the form to submit immediately.

Page 216: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples AExamples A

<input type="image" src="msn.jpg“>

<input type="image" src="m1.jpg" alt="msn-logo">

<input type="image" src="msn.jpg“ alt="msn-logo" height=100 width=50></p>

Page 217: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples BExamples B

<table border=7><tr><td><p align="right"><input type="image" src="msn.jpg" alt="msn-

pictures" height=100 width=50></p></td> </tr></table>

Page 218: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples CExamples C

<form action=“page1.html”>

Name: <input type=“text” name=“name”>

Address:<input type=“text” name=“addr”>

<input type=“submit”>

</form>

Page 219: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Examples DExamples D

<form action=“page1.html”>

Name: <input type=“text” name=“nam”><p>

Address:<input type=“text” name=“ad”><p>

<input type=“image” src=“picture1.jpg”>

</form>

Page 220: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Check Boxes 1Check Boxes 1

The simplest input type is a check box, which appears as a small square the user can select or deselect by clicking. A check box doesn't take any attributes other than NAME:

<INPUT TYPE="checkbox" NAME="baby" VALUE="yes"> Baby Grand Piano <INPUT TYPE="checkbox" NAME="upright"> Upright Piano

Page 221: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Check Boxes 2Check Boxes 2

Selected check boxes appear in the form result sent to the server script as follows:

baby='yes‘ Blank (deselected) check boxes do not appear in the form output result at all. If you don't specify a VALUE attribute, the default VALUE of "on" is used.

Page 222: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Check Boxes 3Check Boxes 3

You can use more than one check box with the same name, but different values, as in the following code:

<INPUT TYPE="checkbox" NAME="pet" VALUE="dog"> Dog<INPUT TYPE="checkbox" NAME="pet" VALUE="cat"> Cat<INPUT TYPE="checkbox" NAME="pet" VALUE="iguana"> Iguana

Page 223: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Check Boxes 4Check Boxes 4

If the user checked both cat and iguana, the submission result would include the following:

pet='cat'pet='iguana'

Page 224: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Check Boxes 5Check Boxes 5

You can define the initial setting for a checkbox by including the checked attribute. When this attribute is set the checkbox will appear to be selected when the form is originally displayed or after the reset button is chosen. The reader can deselect the box by clicking on it. E.g.

<input name=“cats” value=“unsure” type=checkbox checked>Unsure

Page 225: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Radio ButtonsRadio Buttons

The Radio Type defines an item where only one value can be selected from a set of possibilities. Just use TYPE="radio" and give each of the options its own INPUT tag, as in the following code:

Page 226: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example:Example:

<INPUT TYPE="radio" NAME="card" VALUE="v" CHECKED> Visa <INPUT TYPE="radio" NAME="card" VALUE="m"> MasterCard <INPUT TYPE="radio" NAME="card" VALUE=“d"> Discover <INPUT TYPE="radio" NAME="card" VALUE=“a"> American Express

Page 227: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Hidden TypeHidden Type

If you want to send certain data items to the server script that processes a form, but you don't want the user to see them, you can use the INPUT TYPE="hidden" attribute. This attribute has no effect on the display at all; it just adds any name and value you specify to the form results when they are submitted. For this attribute to have any effect, someone must create a script or program to read this line and do something about it.

Page 228: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Hidden Type Continues…Hidden Type Continues…

Most scripts require at least one or two hidden input elements. Consult the person who wrote or provided you with the script for details. You can also use hidden items to indicate which of the many similar forms a particular result came from.

Page 229: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<input type=“hidden” name=“type” value=“websurvey”>

(Or)

<hidden name=“type” value=“websurvey”>

Page 230: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

TextAreaTextArea

The <INPUT TYPE="text"> attribute mentioned earlier only allows the user to enter a single line of text. When you want to allow multiple lines of text in a single input item, use the <TEXTAREA> and </TEXTAREA> tags instead. Any text you include between these two tags will be displayed as the default entry.

Page 231: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

ExampleExample

<TEXTAREA NAME="comments"> Please send! </TEXTAREA> <TEXTAREA NAME="comments" rows=10> Please send!</TEXTAREA> <TEXTAREA NAME="comments" cols=10> Please</TEXTAREA> <TEXTAREA NAME="comments" rows=10 cols=8> Please</TEXTAREA>

Page 232: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

TextArea Attribute: WrapTextArea Attribute: Wrap

This attribute controls how word wrapping for text input should be handled. The following value may be used:

Off: No wrapping.

Page 233: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Select Select

Both scrolling lists and pull-down pick lists are created with the <SELECT> tag. This tag is used together with the <OPTION> tag.

Page 234: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Option AttributeOption Attribute

Option element should be used only with in a select element. It represents one choice in a list of alternatives. Once the user has selected an option from the list, it becomes the visible element in the pull-down list. Two attributes may be used with Option.

Page 235: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Option Attribute 2Option Attribute 2

Selected:This attribute causes the option to be selected until the user chooses another option.

Value:Specifies a value to be returned if the option is chosen If no value is specified, the content of the option element is returned.

Page 236: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example – IExample – I

<SELECT NAME="extras"> <OPTION value=“EW” SELECTED> Electric windows <OPTION value=“amfm”> AM/FM Radio <OPTION value=“tc”> Turbocharger </SELECT>

Page 237: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Size AttributeSize Attribute

The size attribute allows you to tell the browser the number of options that should be displayed simultaneously.

Page 238: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example - IIExample - II

<SELECT NAME="extras“ size=2> <OPTION value=“EW” SELECTED> Electric windows <OPTION value=“amfm”> AM/FM Radio <OPTION value=“tc”> Turbocharger </SELECT>

Page 239: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Multiple AttributeMultiple Attribute

It allows user to choose more than one option.

Page 240: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example – IIIExample – III

<SELECT NAME="extras“ size=2 multiple> <OPTION value=“EW” SELECTED> Electric windows <OPTION value=“amfm”> AM/FM Radio <OPTION value=“tc”> Turbocharger </SELECT>

Page 241: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Button ElementButton Element

The Button Element was introduced in HTML 4.0 and is used to create a click-able button. The Button element’s strength over the input element’s button type lies in its display customizing features. The Button element is intended to display anything within the <button> </button> tags as part of the button. Thus it can be used to create graphical buttons that include text labels.

Page 242: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

PropertiesProperties

NameType = button | submit | ResetDisabled

Page 243: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example – IExample – I

<button type="reset" name="b">

<b> My Place </b>

<img src=picture.jpg align=right hspace=10 width=50 height=50>

</button>

Page 244: HTML [Hyper Text Markup Language]. HTML Hypertext: It provides a way to create a link between information in the same document as well as in different

Example - IIExample - II

<button type="reset" name="b" disabled>

<b> Tomato place </b>

<img src=picture.jpg align=right hspace=10 width=50 height=50>

</button>