HTML (By Aniket)
HTML (By Aniket)
INTRODUCTION
is use to add extra features like formatting multimedia images & symbols.
HTML is the Language with its own syntax & rules it is used only for
web documents are made up of WebPages. HTML is the language i.e. used to
Opera & Google Chrome) are inbuilt with the interpreter of HTML.
1
Web Designing Book (HTML & DHTML)
required.
HTML pages can view any where independent of hardware & text editor
2
Web Designing Book (HTML & DHTML)
common attributes like heading, paragraph, title & etc. Also have specific
time of using these attributes. HTML file have an extension .html & .htm.
There are various elements that can be used to construct the HTML pages.
These elements are called as HTML tags. HTML tags comprises left angular
bracket followed by name of tag & close by right angular bracket. (<HTML>).
1. Container element:
These elements must have starting & ending tag. End tags have
E.g. <HTML>......</HTML>
2. Empty element:
Empty element does not have closing tag. It does not contain
any text.
e.g. <BR>
There are three HTML elements that for basic document structure of
3
Web Designing Book (HTML & DHTML)
1. HTML Element:
The first tag of every HTML document is <HTML>. It indicates that the
2. HEAD Element:
tag.
3. BODY Element:
Other than <HTML> & <HEAD> all the other tags & text of HTML
page is placed within the <BODY> tag. This tag specifies body
<HTML>
<HEAD>
<TITLE> Basic structure of HTML Page</TITLE>
</HEAD>
<BODY>
-----------------
-----------------
</BODY>
</HTML>
4
Web Designing Book (HTML & DHTML)
Tags define the different part of document. Tags are required for
creating every HTML page. They are set of symbol with special meaning.
Tags are used to make a block of text in HTML. An HTML tag comprises left
angular bracket followed by name of tag & closed by Right angular bracket.
Some tag can be nested within each other. These tags start earlier
ends later.
<U><B>XYZ</B></U>
the tags. Attribute is separated by space after the tag name within angular
bracket. Any attribute which is unknown for tag is not giving any effect &
----------------
----------------
</BODY>
<HTML> Tag:
This is the first tag in every HTML document. This tag indicates that
contents of file are in HTML. This tag is mandatory. If it is not use browser
will not identify following text as HTML & will not display properly or
5
Web Designing Book (HTML & DHTML)
anything. Text & all other element of HTML are place within HTML tag. The
HTML element is container element & hence has opening & closing tag.
-----------
-----------
</HTML>
<HEAD> tag:
title of HTML page with in <HEAD> tag. Enable to provide titled for HTML page.
<TITLE> Tag:
This tag is use in the <HEAD> tag to provide the title to the page.
e.g. <HTML>
<HEAD>
<TITLE>EXAMPLE 1</TITLE>
</HEAD>
</HTML>
<BODY> Tag:
Other than HTML & HEAD tag all other tags and entire text is place
within body tag. This tag is a container tag. The body tag forms the body of
6
Web Designing Book (HTML & DHTML)
BACKGROUND
document.
<body background=”../foldername/image1.jpg”>
BGCOLOR
<body bgcolor=”red”>......</body>
Teal, Aqua, Brown. Instead of colour name we can also use RGB
system prefix with # sign. The first two digits are from red, next
<body bgcolor=”#1241EE”>
TEXT
This attribute is used to change the colour of text in the web page.
Colour can be given simply colour name or 6 digit RGB colour code.
7
Web Designing Book (HTML & DHTML)
<HTML>
<HEAD>
<TITLE>Hello</TITLE>
</HEAD>
<BODY>
HELLO
</BODY>
</HTML>
2. Write a HTML program to change the background colour & text colour of
webpage.
<HTML>
</BODY>
</HTML>
<HTML>
<BODY BACKGROUND=”../image1.jpg”>
</BODY>
</HTML>
8
Web Designing Book (HTML & DHTML)
HEADING Tag:
The font style can be change using heading tag. HTML defines six
E.g <H1>Heading</H1>
Output: HEADING
The heading can be align with align attribute which can take left, right,
center as value. For making heading center align, right align, left align. The
<H1 align=”right”>DEMO</H1>
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<H1>HELLO WORLD</H1>
<H2>HELLO WORLD</H2>
<H3>HELLO WORLD</H3>
<H4>HELLO WORLD</H4>
<H5>HELLO WORLD</H5>
<H6>HELLO WORLD</H6>
</BODY>
</HTML>
9
Web Designing Book (HTML & DHTML)
<B> tag:
Bold face element: this tag specified that enclose text should be
<U> tag:
display underline. <U> tag is container tag. It is use to underline the text.
<U>My page</U>
<I> tag:
<I>My page</I>
<BIG> tag:
This tag is use to display text in big size compare to default size. This
is container tag.
<big>My page</big>
<SMALL> Tag:
This tag is use to display text in small size compare to default size.
<small>My page</small>
10
Web Designing Book (HTML & DHTML)
<SUP> tag:
This tag is use to display text in super script format. This is container tag.
<sup>degree</sup>
<SUB> tag:
This tag is use to display text in sub script format. This is container tag.
<sub>demo</sub>
<EM> Tag:
This tag is used emphasis the text. This result is a italic text. This is
container tag.
<STRONG> Tag:
This tag is used to strong emphasis the text. It displays bold text. It is
container tag.
<HTML>
<BODY>
This is a <B>chemical</B> called as <I> H<SUB>2</SUB>
SO<SUB>4</SUB>.</I>
<U>This chemical is at 4<SUP>th</SUP>position.</U>
</BODY>
</HTML>
11
Web Designing Book (HTML & DHTML)
<PRE> Tag:
The <PRE> Tag is the container tag & is most common & useful for
PRE formatting text. Any text formatting element can be used inside <PRE>
tag.
<STRIKE> Tag:
This tag is used to draw Horizontal line through the middle of the
<STRIKE>DEMO PAGE</STRIKE>
<BR> Tag:
The line break element enables you to insert a line break or to move
the cursor in next line. It is represented by BR tag. This tag inserts line
E.g. Demo<BR>Page
O/p Demo
Page
<Font> tag:
This tag is used to change the font, size & alignment of text. This is
the container tag. This tag having several Attributes & these attributes are,
Face: This Attribute is use to display text on the screen provided that type
12
Web Designing Book (HTML & DHTML)
Size: this attribute is represented as Font size. the valid range 1 to 7 &
default size is 3. The value of size can have (+) or (-) sign in front of font. If
the font size above server or below 1 the value of 7 and 1 will be used.
Color: It changes the colour of text that will appear on the screen. The
Align: This attribute is used to align the text right, center & left.
Horizontal Ruler:
<HR> Tag:
Horizontal rule tag specifies a horizontal to be draw across the page. The
tag used for specifying horizontal rule is <HR>. The tag has following
attribute.
Size: this attribute determine the thickness of horizontal rule. The value
13
Web Designing Book (HTML & DHTML)
Color: color attribute is used to specify color of horizontal rule this can be
set as follows.
<HR COLOR=#RRGGBB>
Width: The default horizontal rule is always as wide as the page. The width
Align: If horizontal rule is not equal the width of page then alignment of
rule can be set. The alignment can be left right or center. The default align
is left.
<HR Align=”center”>
<HR NOSHADE>
6. Write a program to change the font face, size & color of text.
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<FONT FACE=”VERDANA” SIZE=2 COLOR=RED>THIS IS A DEMO
PAGE</FONT>
</BODY>
</HTML>
14
Web Designing Book (HTML & DHTML)
<Marquee> Tag:
Behaviour: this attribute set movement of marquee. This attribute have any
of following value.
1. Scroll: move text from one margin across to other margin completing
2. Slide: Move text from the one margin & bounce back as soon as text
3. Alternate: bounces the text back & forth between the margins.
Direction: This attribute specify the direction of the text. The direction can
be specifying either left or right. The default marquee move from right of
Height: This attribute is specifying the height of marquee area. This value
page.
15
Web Designing Book (HTML & DHTML)
Width: This attribute specify width of marquee area. This value can be
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<MARQUEE DIRECTION=LEFT>HELLO</MARQUEE>
<MARQUEE DIRECTION=RIGHT>HELLO</MARQUEE>
<MARQUEE DIRECTION=UP>HELLO</MARQUEE>
<MARQUEE DIRECTION=DOWN>HELLO</MARQUEE>
</BODY>
</HTML>
16
Web Designing Book (HTML & DHTML)
<P>Tag:
tag. I.e. paragraph tag<p>. This tag is used to show what text in document
constitutes the paragraph. I.e. all the text between <P> tags is single
paragraph when we start new paragraph browser will insert & align between
to paragraph. In <P> tag browser will ignore more than one space & any no.
of written.
<P> I am Developer</p>
COMMENT Tag:
<TT> Tag:
Teletype writer tag is use to display contents with mono space type
<TT>DEMO PAGE</TT>
17
Web Designing Book (HTML & DHTML)
image format are available such us gif, Jpeg, pcx, wmr, bmp, etc. Jpeg &
gif format support wide in line of body text so called as inline images.
<IMG>Tag:
The image tag incorporate graphics into HTML document. Image tag is an
image it can have left, right, center align horizontally & top, Bottom
3. ALT: The ALT attribute is used to specify alternate text. That can be
faster.
18
Web Designing Book (HTML & DHTML)
4. Width: This attribute is used to set the width of the image. The width
5. Height: This attribute is used to set the height of the image. The
6. Border: By default browser display image with border around it. The
border attribute of IMG tag can be set by providing value for border
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<IMG SRC=”IMAGE1.JPG” WIDTH=300 HEIGHT=250 ALT=”IMAGE1”>
</BODY>
</HTML>
19
Web Designing Book (HTML & DHTML)
<A> Tag:
HTML provide an anchor element. To mark text as a link the <A> tag use.
This is a container tag. Anchor tag have HREF attribute. This is mandatory
Also image can be uses as anchor for the hypertext line it can be uses as
follows
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<A HREF=”demopage1.html”>Click here</A>
<A HREF=”www.google.com”>Google</A>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<A HREF=”www.yahoo.com” ><IMG SRC=”IMAGE2.JPG”></A>
</BODY>
</HTML>
20
Web Designing Book (HTML & DHTML)
within the body tag. Some of commonly used list items are
1. Directory list
2. Ordered list
3. Unordered list
4. Menu list
5. Definition list
1. Directory list:
directory list beginning with <DIR> tag & followed by <LH> tag for list
E.g.
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<DIR>
<LH>PERIFERALS </LH>
<LI>MOUSE</LI>
<LI>KEYBOARD</LI>
<LI>PEN DRIVE</LI> </DIR>
</DIR>
</BODY>
</HTML>
21
Web Designing Book (HTML & DHTML)
Output:
PERIFERALS
MOUSE
KEYBOARD
PEN DRIVE
2. Ordered list
The ordered list element is used to present the numbered list of the
item. In the ordered list begin with <OL> & followed by <LH> & <LI> tag.
<HTML>
<BODY>
<OL>
<LH>WEEKDAYS</LH>
<LI>SUNDAY</LI>
<LI>MONDAY</LI>
<LI>TUESDAY</LI>
</OL>
</BODY>
<HTML>
Output:
WEEKDAYS
1. SUNDAY
2. MONDAY
3. TUESDAY
22
Web Designing Book (HTML & DHTML)
1. Type: This attribute provides the various types number to the list
following are the values of which can be assign with type to different
output.
Unordered List:
bullet. Unordered list start with <UL> followed by <LI> tag. The type
1. Circle
2. Disc
3. Square
23
Web Designing Book (HTML & DHTML)
<HTML>
<HEAD>
<TITLE>DEMO PAGE</TITLE>
</HEAD>
<BODY>
<UL TYPE=”SQUARE”>
<LI TYPE=”CIRCLE”>MOUSE</LI>
<LI>KEYBOARD</LI>
<LI>MONITOR</LI>
</BODY>
</HTML>
OUTPUT:
o MOUSE
KEYBOARD
MONITOR
Menu list:
The menu list element display list of item of on item per line it is
more compact than unordered list menu list begin <menu> tag & followed
by <LI> tag.
24
Web Designing Book (HTML & DHTML)
OUTPUT:
COMPUTER
LAPTOP
Definition List:
This list are also called glosser list. This list have format similar to
directory list <DL>, <DT> & <DD> are the tags used to define Definition tag.
<HTML>
<BODY>
<DL>
<DT>CPU
<DD>The control processing unit
</DL>
</BODY>
</HTML>
OUTPUT:
CPU
The control processing unit
25
Web Designing Book (HTML & DHTML)
Table are use to present data in tabular format. Data is easier to read
when presented using table. We can display paragraph within the data cell.
element to create a table. Some basic tag which are required for creating a
1. <Table> tag:
The table tag is used for creating the table. It is a container tag.
Table element starts with <table> tag & ends with </table> tag.
2. <TR> tag:
This tag is used to specify table row. This is container tag. The
3. <TH> tag:
This is stand for table header by default header cell is in bold &
center aligns. Table header should be enclose with in <TH> & </TH>
26
Web Designing Book (HTML & DHTML)
4. <TD> tag:
<TD>&</TD> tag.
5. <CAPTION> tag:
To specify the caption of the table <CAPTION> tag is used the caption
<TABLE> tag.
Attributes:
1. Border: Border attribute draws border around the entire table cell.
specify by using
<table border=3>
2. Cell Spacing: The space between cells in the table can be specified
defined in pixels.
<table cellspacing=30>
3. Cell padding: The space between cell data & cell wall in the table
27
Web Designing Book (HTML & DHTML)
<table cellpadding=40>
4. Align: this attribute is used to align the table to the left, right &
<table align=”right”>
<table valign=”top”>
7. Border color: This attribute is use to set the border colour of the
rowspan & colspan are used. These attributes can appear with in any
table cell. The rowspan specifies the no. of rows the cell can span.
The default span of any cell is one. The colspan specified no. of
column the cell can span. The default cell span for any cell is one.
<td rowspan=3>
28
Web Designing Book (HTML & DHTML)
1 2
3 4
<HTML>
<BODY>
<TABLE BORDER=1>
<TR>
<TD>1</TD>
<TD>2<TD>
</TR>
<TR>
<TD>3</TD>
<TD>4</TD>
</TR>
</TABLE>
</BODY>
</HTML>
A B C D
E F G H
<HTML>
<BODY>
<TABLE BORDER=1>
<TR>
<TD>A</TD>
<TD>B<TD>
<TD>C</TD>
<TD>D<TD>
</TR>
<TR>
29
Web Designing Book (HTML & DHTML)
<TD>E</TD>
<TD>F</TD>
<TD>G</TD>
<TD>H<TD>
</TR>
</TABLE>
</BODY>
</HTML>
NE
TWO THREE
<HTML>
<BODY>
<TABLE BORDER=1>
<TR>
<TD COLSPAN=2 ALIGN= CENTER> ONE</TD>
</TR>
<TR>
<TD>TWO</TD>
<TD>THREE</TD>
</TR>
</TABLE>
</BODY>
</HTML>
30
Web Designing Book (HTML & DHTML)
ONE
TW
THREE
O
A B C D
<HTML>
<BODY>
<TABLE BORDER=1>
<TR>
<TD COLSPAN=4 ALIGN= CENTER> ONE</TD>
</TR>
<TR>
<TD COLSPAN=2 ALIGN=CENTER>TWO</TD>
<TD COLSPAN=2 ALIGN=CENTER>THREE</TD>
</TR>
<TR>
<TD>A</TD>
<TD>B<TD>
<TD>C</TD>
<TD>D<TD>
</TR>
</TABLE>
</BODY>
</HTML>
31
Web Designing Book (HTML & DHTML)
1 2
Red Blue
3 4
Green cyan
<HTML>
<BODY>
<TABLE BORDER=1>
<TR>
<TD BGCOLOR=”RED”>1</TD>
<TD BGCOLOR=”BLUE”>2<TD>
</TR>
<TR>
<TD BGCOLOR=”GREEN”>3</TD>
<TD BGCOLOR=”CYAN”>4</TD>
</TR>
</TABLE>
</BODY>
</HTML>
21.Write a program to create following table on webpage & set the image in
the table cell as follows. Consider width & height=100 pixels
Image1 Image2
Image3 Image4
<HTML>
<BODY>
<TABLE BORDER=1>
32
Web Designing Book (HTML & DHTML)
<TR>
<TD>
<IMG SRC=”IMAGE1.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
<TD>
<IMG SRC=”IMAGE2.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
</TR>
<TR>
<TD>
<IMG SRC=”IMAGE3.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
<TD>
<IMG SRC=”IMAGE4.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
33
Web Designing Book (HTML & DHTML)
22.Write a program to create following table on webpage & set the image in
the table cell as follows. Consider width=100% & HEIGHT=200px.
Image1 Image2
50% 50%
<HTML>
<BODY>
<TABLE BORDER=1 WIDTH=100% HEIGHT=200>
<TR>
<TD WIDTH=50%>
<IMG SRC=”IMAGE1.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
<TD WIDTH=50%>
<IMG SRC=”IMAGE2.JPG WIDTH=100 HEIGHT=100 ”>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
34
Web Designing Book (HTML & DHTML)
& as such, many people have rigid opinions about them. In fact many people
The give you the ability to split the browser window into vertical &
different pages into the various frames in the browser, creating a multipage
display. With frames, you have a significant amount of added control over
<FRAMESET> Tag:
This tag is used to configure the frames. This tag is written inside the
body tag to display the frame. This is a container tag. <FRAMESET> tag
ROWS: this attribute is used to create horizontal frame & set the no. of
rows. The rows attribute accept value in the form of pixels & percentage of
<FRAMESET ROWS=”50%,50%”>
COLS: This attribute is used to create vertical frames & to set the no. of
column. The cols attribute accept value in the form of pixel & percentage of
<FRAMESET COLS=”50%,50%”>
Here use can use an asterisk () to represent the rest of space available in
the window.
35
Web Designing Book (HTML & DHTML)
<FRAME> tag:
Frame tag is used to create the actual frame in the web page. This is a
empty tag. This has SRC attribute which is mandatory with frame tag. In src
attribute we have to give the path of the web page which we want to
display.
<Frame src=”page1.html”>
Attributes:
FRAMESPACING: Set the spacing between frames. The frame spacing can be
BORDER: This attribute is used in the outermost FRAMESET tag to set the
border thickness for all frames within the FRAMESET. Set to positive integers
indicating the pixel space between frames; set to 0 set the FRAMEBORDER
to NO.
Netscape navigator set to yes and no; for internet explorer lists, set to 1
and 0.
BORDERCOLOR: Sets the color used for frame border. This setting overrides
default; lets the browser decide when to display scrollbars), YES (always
36
Web Designing Book (HTML & DHTML)
resized. The default is that frames may be resized by dragging the border.
PAGE1.HTML PAGE2.HTML
PAGE3.HTML PAGE4.HTML
<HTML>
<HEAD>
<FRAMESET ROWS=”50%,50%” COLS=”50%,50%”>
<FRAME SRC=”page1.html”></FRAME>
<FRAME SRC=”page2.html”></FRAME>
<FRAME SRC=”page3.html”></FRAME>
<FRAME SRC=”page4.html”></FRAME>
</HEAD>
</BODY>
</HTML>
PAGE1.HTML
PAGE2.HTML
PAGE3.HTML
37
Web Designing Book (HTML & DHTML)
<HTML>
<HEAD>
<FRAMESET COLS=”100%”>
<FRAMESET ROWS=”30%,30%,”>
<FRAME SRC=”page1.html”></FRAME>
<FRAME SRC=”page2.html”></FRAME>
<FRAME SRC=”page3.html”></FRAME>
</HEAD>
</BODY>
</HTML>
PAGE1.HTML
PAGE2.HTML
PAGE3.HTML
<HTML>
<HEAD>
<FRAMESET COLS=”100%”>
<FRAMESET ROWS=”30%,30%,”>
<FRAME SRC=”page1.html”></FRAME>
<FRAME SRC=”page2.html”></FRAME>
<FRAME SRC=”page3.html”></FRAME>
</HEAD>
</BODY>
</HTML>
38
Web Designing Book (HTML & DHTML)
PAGE1.HTML
HEIGHT=150
PAGE2.HTML
HEIGHT=150
PAGE3.HTML
<HTML>
<HEAD>
<FRAMESET COLS=”100%”>
<FRAMESET ROWS=”150,150,”>
<FRAME SRC=”page1.html”></FRAME>
<FRAME SRC=”page2.html”></FRAME>
<FRAME SRC=”page3.html”></FRAME>
</HEAD>
</BODY>
</HTML>
39
Web Designing Book (HTML & DHTML)
PAGE1.HTML
PAGE2.HTML
PAGE3.HTML
<HTML>
<HEAD>
<FRAMESET COLS=”100%” FRAMESPACING=0 FRAMEBORDER=0
BORDER=0>
<FRAMESET ROWS=”30%,30%,” FRAMESPACING=0
FRAMEBORDER=0 BORDER=0>
<FRAME SRC=”page1.html” SCROLLING=N0
NORESIZE></FRAME>
<FRAME SRC=”page2.html” SCROLLING=NO
NORESIZE></FRAME>
<FRAME SRC=”page3.html” SCROLLING=N0
NORESIZE ></FRAME>
</HEAD>
</BODY>
</HTML>
40
Web Designing Book (HTML & DHTML)
HTML form is nothing but a webpage which allows the user to enter
the data. The simplest example of the form is the feedback from which
available on the web. We need to fill these forms, & submit them. The form
may contain the information like name of the user, Email address if any
feedback text etc, and we will be provided with the command buttons push
When we are dealing with the form we are using the different objects
like text items, static texts, radio buttons, check boxes, selection lists, push
buttons etc. Before using form we should know the working of the form i.e.
internally how the processes are performed. In the form we should have a
submit button. After pressing this button the data entered by the user is
When the data is entered in the form, some validation process can be
carried out, for these validation processes we can make use of different
script languages like java script or VB script. These scripts are even used to
navigate through the form by usage of different keystrokes. Once the data is
transferred, the server should have the program to process the data.
Creating the form is a very easy task. We need to use some tags like
<FORM>, <INPUT> & etc. To start with we need to use the tag browser about
41
Web Designing Book (HTML & DHTML)
the form which we are going to create in our HTML script. This tag has two
METHOD indicates the type of work the form is going to do. This
METHOD is normally POST. Which means that the inputs of the form are to
the METHOD could be GET, in which METHOD submits the result as a part of
URL header. For example GET is sometimes used when submitting queries to
the search engines form a web page. This method is normally used when a
the server computer that will process the information entered by the user.
This address is available with your ISP (internet service provider) as the
person who is maintaining web services. The script can be written in any
script.
except. Many HTML controls are created with the <INPUT> element. Using
different value for the TYPE attribute to create the various controls.
<INPUT TYPE=”TEXT”>: this type of control creates the text field on the
Attribute:
Size: Sets the size of the text field in characters. Set to positive integer.
42
Web Designing Book (HTML & DHTML)
Readonly: Indicates that the content of the text field may not be modified.
field. In this field user can give password. The password can be shown in the
Attribute:
Size: Sets the size of the text field in characters. Set to positive integer.
Attribute:
Value: Gives this button another label besides the default, Reset.
because when you clicked this button, all the data in the form was sent to
43
Web Designing Book (HTML & DHTML)
The web server for more processing. However, more and more forms are
appearing that handle all the processing they need without sending anything
Attribute:
Value: Gives this button another label besides the default, submit query.
<INPUT TYPE=”RESET”>: Allows the user to clear all the data they’ve
entered and start over. When the user clicks the reset button, all the
controls in the form are returned to their original state, displaying the data
Attribute:
Value: Gives this button another label besides the default, Reset.
which when selected, displays a dot in the middle. These controls act much
like checkboxes except that they work in mutually exclusive groups in which
Attribute:
44
Web Designing Book (HTML & DHTML)
checkmark in it. The user can toggle the checkmark on or off by clicking the
checkbox.
Attribute:
<TEXTAREA>: Are two dimensional text fields, allowing the user to enter
more than one line of text. Text areas can also support text wrapping. Rows
& cols are two attributes use to set the dimension of text area.
Attribute:
Rows: Specifies the number of rows in the control. Set to positive integer.
integer.
Readonly: Indicates that the content of the text area may not be modified.
<SELECT>: Displays a select control, much like a drop-down list box which
further called combo box. In combo box user can select only one option.
Attribute:
Size: Gives the number of items visible in the list. Set to positive integer.
Attribute:
Value: Holds the value to be sent to the server if the item is chosen. The
45
Web Designing Book (HTML & DHTML)
box. In this user can select multiple choices from the list.
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”TEXT” SIZE=25></INPUT>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”PASSWORD”></INPUT>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”BUTTON” VALUE=”OK”></INPUT>
</FORM>
</BODY>
<HTML>
46
Web Designing Book (HTML & DHTML)
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”SUBMIT” ></INPUT>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”RESET” ></INPUT>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
Username:<INPUT TYPE=”TEXT” SIZE=20 ></INPUT>
<BR>
Password:<INPUT TYPE=”PASSWORD” SIZE=20 ></INPUT>
<BR>
<INPUT TYPE=”BUTTON” VALUE=”Login”></INPUT>
<INPUT TYPE=”RESET”></INPUT>
</FORM>
</BODY>
<HTML>
<HTML>
47
Web Designing Book (HTML & DHTML)
<BODY>
<FORM>
<TABLE>
<TR>
<TD> Username:</TD>
<TD><INPUT TYPE=”TEXT” SIZE=20 /><TD>
</TR>
<TR>
<TD>Password:</TD>
<TD> <INPUT TYPE=”PASSWORD” SIZE=20 /><TD>
</TR>
<TR>
<TD> </TD>
<TD><INPUT TYPE=”BUTTON” VALUE=”Login”/>
<INPUT TYPE=”RESET”/></TD>
</TABLE>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
<INPUT TYPE=”CHECKBOX” />Windows><BR>
<INPUT TYPE=”CHECKBOX” />Linux<BR>
<INPUT TYPE=”CHECKBOX” />Solaris><BR>
</FORM>
</BODY>
<HTML>
<HTML>
<BODY>
<FORM>
48
Web Designing Book (HTML & DHTML)
49
Web Designing Book (HTML & DHTML)
<SELECT>
<OPTION VALUE=”1”>Tea</OPTION>
<OPTION VALUE=”1”>Coffee</OPTION>
<OPTION VALUE=”1” SELECTED>
Cold drink</OPTION>
</SELECT>
</FORM>
</BODY>
</HTML>
50