More On HTML
More On HTML
Chapter Focus
You are already familiar with the basic
concepts of HTML. You arc equipped to Lists
Tables
design a webpage with the help of the basic
Forms
tags like <HEAD>,<TITLE>, <BODY> and
<ADDRESS>, Attributes like BGCOLOR, / Image
/ Hyperlinks
BACKGROUND and TEXT help in adding
greater visual appeal to the webpage. You are
now also capable of adding formatting features in your webpage with the help of tags like <P>
<BR>,  , heading tags (<H]><H6>), <HR>, <B>, <>, <U>, <CENTER>, <FONT>
<SUP>, <SUB> and <S>,
HTML
Effective web pages have some unigue features that distinguish them. Some of the features of
a good website are:
/ It must be visually appealing.
The colour scheme selected must be simple.
/ The graphics that are used in the page must have relevance.
The text content must be read easily. amy
/ The font used must be commonly available.
The content must besegregated properly using lists and tables.
/ Images must be placed and linked properly.
There should not be too many images on the page otherwise, it may take a very long time to
load.
J Scrolling of the page must beavoided. In case of a larger content, the content must be divided
and loaded on request with a hyperlink.
J One should be able to navigate forward as well as backwards to the home page in a website.
/ The website must be interactive. It must be able to gather data forms from the user and store
them for Tater use.
86
Itshould be able to highlight any small text. In anutshell, the website must be impressive as
well as User friendly. Our chapter will introduce the concept of lists, tables, images, forms and
hyperlinksto enable you to create
effective webpages.
LISTS
(Alistis a number of connected items or names written or printed consecutively, typically one
belowthe other. In a webpage, a list may be created to make a piece of information more
[Link] the following kinds of lists:
Unorderedlists
/ Ordered lists
Definition lists
<BODY> TEACHERS
" STUDENTS
COMPONENTS
THE FOLLOWING ARE THE INTEGRAL
" MANAGEENT
-TEACHING
NON-TE STAFF
0F A SCHOOL
<UL TYPE = FILLROUND>
<LI> TEACHERS
Conputer |Protetted Mode Oft ,100%
<LI> STUDENTS Don
</0L>
</BODY>
</HTML Figure 7.1.
gves the output as shown inthe
87
Ordered Lists (OL)within the <OL> and </OL> tags. Each individual item starts
This is specified with the <Lb
possible inthistag.)(6)
tag. TYPE, START and VALUE are thethree attributes
1. TYPE--It selects the type of numbcringto be used.
series automatically, starting trom I. TYPE
sgenerates nunmbers in a
"A" scrics automatically, starting from A. TYPE= g"
SnateS Capital letters in a d.
generates small letters in aseries automatically, starting from from I
generates capital Roman letters in a series automatically, starting
DT automatically, starting fromni
in a series
e T generates small Roman letters
list. This 1s used ifone wants to
kARTItsclects the starting value of anumbered
give a value other than the starting values mentioned above.
change the numbering in the middle
(3. ALUE-It isgiven with the <L> tagthat helps to sCHOOt- Windows Internet Erplorer
A
For example, the code: () CAUzers Arijt Desk - ,X
Odentty Sste-Exees -
Nerton. Lcense Expred
<HTML> ir favorites
a t 1ELTS - Treiners Zone Bol OAMsR GoLaD Bt
ASCHOOL
<HEAD> following fac dities
Any school should hre the
</TITLE> Cafeteria
</HEAD>
<BODY>
<LI> Library e - o
CAUsers\Ari1ti Desk
2License Expred O dentty Safe- Exered -
Norton
<LIS Laboratories Favorites e IELTS - Trainers Zone Bois OAsMaR GoLaP BaL
Pace
ASCHOOL
</0L>
</BODY>
</HTML> Dons
Conputes | Proteted Mode Otf
J009%
<HEAD>
88
TITLE> SCHOoI,
SCHOOL - Windows Internet Explorer
</TITLES
-oi 7
e CUsers\ Aryjit\ Desh
Exored
</HEAD> Norton . License Expred O dentty Safe -
Favorites 1ELTS - Trainers Zone
<BODY>
ASCHOOL
should
Any school have the Any school should have the fotlowing facities
<LI> Laboratories
Computer | Protected Mode: Of 10075
<HEAD>
<TITLE> SCHOOL
</TITLE>
</HEAD>
<BODY>
</OL>
</BODY> Computer | Protected Mode: Off
</HTML>
89
generates the output as shown in Figurc 7.5.
The difference in outputs slhown in igures 7.4 and 7.5 mcans that in case of letters. the list
restarts from the beginning ITrespective of the value provided.
<HEAD> A SCHOOL
<DI> Student
</BODY>
</ETML>
generates the output as shown in Figure 7.6.
TABLES
(A table is a collection of related data items (rows) that are logically arranged into vertical
columns and horizontal rows. It can be displayed in an HTML page using the <TABLE> and
</TABLE>tags. )
Fach row of atable is present within the TR and TR> tags. TR represents Table Row.
Cooh column of atable is present with1n the<TD> and TD>tags. TD represents Table Data.
A beederrow is aspecial kind of à row that Spans acrOss the columns of a table It is defincd
using <TH>and TH,<I>stands for Table Header row \ à
90
following
The
optional attributes can be
givenhorizontally
with the TABLE
1. ALIGN- This attribute aligns the table tag:three possible values-
and has
LEFT CENTER or RIGHT.
2. VALIGN. This attribute aligns the table vertically and has three pOssible values-
TOP, MIDDLE or BOTTOM.
3. WIDTH7 This attribute adjusts the width of the table to the percentage of available
SCreen width or to a given
number of pixcls. In absence of this attribute, the width is
adjusted according to the cell content.
4, BORDER- This attribute decides the border to be placed in a table. The thickness of
the border isgiven inpixels.
5. CELLPADDING- -This attribute
specifies the distance between the cell
boundary and the actual data in the Info Hub
cell. The value is specified in pixels. If ALIGN is present with <TD> or <TH> tags, then
KCELLSPACINGThis attribute it applies only to the current cell.
controls the spacing between adjacent Alignments specified by the TR tag applies to
cells in the table. The value is specified the entire row until specified by the <TH> and
<TD> tags.
in pixels. )()
IThe heading or caption of atablecan be specified by the <CAPTION> and </CAPTION>tag.
The ALIGN attribute of the <CAPTION> tag helps to place the caption of the table either to
the bottom (ALIGN=BOTTOM) or to the top of the table (ALIGN = TOP).) (2)
The following code explains allthe above mentioned attributes
<HTML>
<HEAD>
<TITLE> SCHOOL
</TITLE>
</HEAD>
<BODY>
<8ODY BGCOLOR = LIGHTYELLOW>
E> <CENTER>sTREAMS AVAILABLE</B></CENTER>
<BR><BR><BRKBR>
<CENTER> =1o
CELLPADDING =10 CELLSPACING
<TABLE BORDER=10 width = 25%
<CAPTION ALIGN=BOTTOM>
<B> SUBJECT GROUPS</B>
</CAPTION>
<TR>
<TR ALIGN=CENTER
<TD>MATHS</TD>
<TD>BUSINESs MATHS</TD>
</TR>
<TR ALIGN=CENTER>
<TD>PHYSICS</TD>
<TD>ACcOUNTS</TD>
</TR>
<TR ALIGN=CENTER>
<TD>CHEMISTRY</TD>
<TD>COMMERCE</TD>
ASCHOo.-Wndo lrtemet bplorer
</TR> ( e, CUzers Argi DeitopMore sbout HTMM47Mml
Nerton Lese Expres -
a e atS- Trares Zone Bei OAahtaR GclaP BalL YouTube- Seha Path in R Gooe
<TR ALIGN=CENTER sFaortes
6CHOoL
STREAIS AVAILABLE
<TD>COMPUTER SCIENCE</TD>
<TD>ECONOMI CS</TD> SCIEXCE cOMMERCE
PHYSICS ACCOUNIS
</TABLE> CHEMISTRY cOMMERCE
</CENTER> COMPUTER
SCIENCE ECONOMICS
StAJECT GROUPS
</BODY>
4Computer | Prctected hMode CH
<HEAD>
<TITLE> SCHOOI
</TITLE>
</HEAD>
<BODY BGCOLOR =
LIGHTYELLOW>
<B> KCENTER>REPORT</B></CENTER>
CBR>XBR><BR><BRY
<CENTER>
<TR>
</TR>
<TR>
<TH> MATHS</TH>
<TH> PHYSICS</TH>
</TR>
<TR ALIGN = CENTER
<TD>RAVIK/TD>
<TD>87</TD>
<TD>83</TD>
<TD>95</TD>
93
</TR> sCHOOt -Windowt Intenet Erplorer .4,x|t
Atore abeut HTMLL8S htrnt
e CUters\ ArijiDetoet
<TR ALIGN = U
Lcense trnref -
Osty Ssfe . Expred
YouTube Sshaj Path in A
CENTER></TD> Nerton
Fontes s n tL TS - Trainers Zone J Boti OAstMaf
GoLsP Brt
pPaoe Sefety
<TD>TANIA</TD>
SCHOOL
REPORT
<TD>89</TD> MARKS
<TD>83</TD> NÁME
MATHS PHYSICS
COMPUTER
<TD>99</TD>
</TR> RAVI
99
89 83
TANIA
</CENTER>
Computer | Protected Mode C
</BODY> Dene
<B>SEX</B>
<BR>
value="FEMALE">FEMALE
<BR>
<BR><BR>
<B>STREAM</B>
<BR>
value="SCIENCE">SCIENCE
<BR>
value="COMMERCE">COMMERCE
<BR>
value="ARTS">ARTS
<BR>XBR>
<BR>
96
TEXTAREA>You
may enter the text
<BR><BR>
here</TEXTAREA> e 8> SCHOOL</B> - Windo.
e CAUsers\Arnjit\ Desl X
<INPUT TYPE="SUBMIT!! X Norton
<INPUT
name="SUB" value-"Submit"> Favorites eIELTS - Trainers Zone
TYPE="RESET" name="RES" A<8> SCHOOL</B>
</HTML STREAM
SCIENCE
<HEAD>
Submit Reset
<TITLE>
Computer | Protecte:g 100%
SCHOOL
Fig. 7.9 Output of code
</TITLE>
</HEAD>
SCHOOL - Windows Internet Explorer
<BODY>
cAUsers\Arijit\ Des Bing
Thank you your query has been submitted X Norton LicenseExpired - 6 identty Safe -Expired -
S Favorites eELTS - Trainers Zone
</BODY>
SCHOOL
</HTML
Thank you your query has been submitted
After clicking on the submit button, itopens another
webpage called [Link]. The output is shown
in Figure 7.10. Computer | Protected Mode: Off 100%
<HEAD>
Info Hub
<IITLE> " GIF stands for Graphic Interchange Format,
JPG for Joint Photographic Experts Group and
SCHOOL PNG stands for Portable Network Graphics.
</TITLE> The image should ideally be present within
the same folder, otherwise it must be referred
</HEAD> properly. height and width are not
If
then the image takes a normal size. mentioned,
<BODY>
<IMG WIDTH=450 HEIGHT= 400 SRC ="image2. SCHOU Window letecnet Explres
jpg">
*karates
</BODY>
</HTML>
98
<HTML>
CIO Windes ntrtJeglitet
<HEAD>
roteso
<TITLE>
SCHOOL
</TITLE>
</HEAD>
<HEAD>
<TITLE>
SCHOOL
</TITLE>
</HEAD>
<BR><BR><BR><BR>
The the most popular group of
E-Civilisation
schools the
grouP of schools is one of
having its presence in 30 countries. Finding the
world over
*etent talent of the child is our main focus. The school emphasises on
ie value of education rather than focussing only on knowledge. We also
encourage social, emotional, intellectual and physical growth of child.
focussed on the child.
<BR><BR><BRKBR>
training 1n
The entire effort is
etracurricular activities is
Specialised
provided by the school from a
very early age. The library is equippéd very
well The playground is
very
computer labs
spacious. The school also has well -equipped and all other
facilities that make up a nodern
school.
99
</BODY>
</HTML>
E-CIVILIZATION SCHOOLS
My Corote
HYPERLINKS
Since HTML creates web documents that are supposed to be viewed on a computer screen, it
1S not advisable to increase the length of awebpage abnormally. It decreases the interest of the
browser and more importantly takes a longer time to download. Thus, it is suggested that one
must divide the information logically into a number of modules. Each module might contain
information that is independent of the other modules. So, the user has the freedom tochoose
what he wants to view. Each of these modules may be composed into an individual webpage.
Thus,there should be a way to link these pages so that they may belong to the same group and
be known as a website. This can be achieved by using a feature called hyperlink, or hypertext,
or hotspot.
Ahypertext is different from normal text as it links to other sections of the
website or an
external website. Itcan be distinguished from a normal text as by default a hypertext appears
blue, is underlined and the cursor shape changes to a hand when the
over it.
mouse pointer is placed
100
allowsto set the colours of these different tvpes of following
HTML oft links with the help of the
attributes fthe <BODY> tag:
LINK -COLOUR NAME to mention the colour of the
=COLOUR NAME to specify the colour ofthe hyperlink,
active link and
=COLOUR NAME to represent a visitcd link.
<A> ag may be used to create a hyperlink. <A> refers to an anchor which contains
the
The hypertext.
elernentto linked. The content within <A> and </A>tags become a hyperlink or
be
Clickingonthe hyperlink takes the control to a different section. The section to be navigated
whenthe hyperlinkis clicked has to be specified within the HREF attribute of the <A>tag as
showninthe following syntax:
A HREF= "target [Link]|'"
Basically, a hyperlink may navigate to either
/ Any other web document
, Anyother section within the same document.
Linking to an External Document
Eor linking to an external document, the following syntax may be used:
<A HREF= target [Link]'> text to be hyperlinked </A>
For example, the line of code:
<4 HREF= *[Link]'"> View our teachers </A>
clicked, the webpage called
makes *View our teachers'" as a hyperlink and when it is
of that webpage. The file
teachers html is opened and the control is taken to the beginning
present in the current
[Link] must be present in the current working directory. If it is not
drectory, then a relative path must be mentioned.
go toa particular section of the external document, then named anchors must be
Iwe want to
following steps can be used to take the control to a particular section of the target
usea. The
document: notepad.
Open the target document for editing in made.
which the jump has to be
* Ldentify the section to abel
before that section. use the named anchor to label the place as <A NAME=
O Just NAME="senior school>
Iame>. For example. <A current document.
4, Now save and close the target document and open the
with the filename in the current
5. To hyperlink, mention the label name along
enforce inthe
document the <A>tag as follows: hyperlinked.</A>
"[Link] #label name"> text toobe
<A HREF= school"> View our teachers</AS
[Link]#senior
For CXample, <A HREF=
101
the
Here, *View our teachers" becomes the hyperlink. This when clicked in section browser, opens
the
another existing document called [Link] and places the controlin labelled
senior school as mentioned before.
ror doing this, the same stens bave to be followed as before. The only difference is th¡t the
target filename should be mentioned as the current filename itself. The absence of any filename
before tlhe #signifies that the control has to be transferred to asection in the same webpage.
By doing this, the image becomes a hyperlink which when clicked opens targei_file name.
html.
MARQUEE
The <MARQUEE> tag helps to display a scrolling text. The text within
<MARQUEE> </MARQUEE> tags scrolls, by default, from right to left in the screen.
Announcements that want attention should be placed within this tag. Excessive use of this tag
1S not recommended.
The list of attributes that go with the <MARQUEE> tag are as follows:
ALIGN: This attribute helps to position the marquee element to the TOP, MIDDLE or
BOTTOM of the webpage.
J BGCOLOR:This attribute helps to puta background colour to the marquee element.
J BEHAVIOR: This attribute helps to definethe behaviour of themarauee element. The
Values for this attribute can be set to SCROLL,SLIDE orALTERNATE.
DIRECTION: This attribute defines the direction of movement of the marquee
element. Though the default direction of movement of the marquee element is from
richt to left, it can be made to move from lett to right by
setting the direction to
RIGHT.
102
HEIGHT: This
attribute setsthe height of thc clement cither in pixcls or in
percentage. marquce
WIDTH: This: attribute sets the
percentage. width of the clement either in pixels or in marquce
exaiple, thecode:
Éor
HTMLS
(BODY>
My Conputer 100%
My Computer 100%
Tech Bytes
Controls: textor items within a form that
List: a number of connected items present may bemodified by the user
consecutívely Hypertext: it is ditterent trom a normal text
Table: a collection of related data stored in as it links to other sections of he website or
vertical columns and horizontal rows an externalwebsite
Form: a structure to collect some
information from the user of that page
systematically
103
Bitsto Remember
lists.
Alist in HTML can be either Unordered (Bulleted), Ordered or Definition
/ Each item in a list
starts with the <L> tag.
/A bulleted list may be
by <UL> and </UL> tags.
createdwithin
/An ordered list is specified the <OL> and </OL> tags. within
definition term is given
A definition list is enclosed <DL> and </DL> tags. The
<DT> and the description is within
the
given witlhin <DD> tags.
Atable may be created usinp the <TABLE>... </TABLE> tags. represented within <TD>
/ Each row is represented by <TR>....</TR> tags and cach column is
<TD> tags.
V The header row can be specifed by the <TH>.../TH> tAgs
V<CAPTION>,..</CAPTION> helns togive aheading tothe tab
VThe <FORM>....<FORM> tags may be used to create aform.
or multiline text boxes are some of the controls
ooutonS, check boxes, text box. nassword text
that can be embedded in aform.
VA form may be sent toprocessing agentusing the submit button.
V Allthe values of the form can be set to the initial mode using the Reset buto
/ The <IMG> tag is used to insert an image.
Y LneSRCattribute may be used to Specify the URL or path
of the image that has to be embedded.
the same page or
Anyperlink may be created by the anchor tag<A>....<A>. It helps to link either to
to any other webpage.
The HREF attribute may be used to specifythe target file name.
/ The images may also be used to hyperlink.
ASSESSMENT ZONE
104
whether the
[Link] following
statements
[Link] must be used area True
to jump to or False.
particular scction of the main document.
The ROWSPAN instructs the browser to take
2.
3. The <DD> contains the definition term.
un more than one column.
ALIGN= MIDDLE ensures that the
4. Image will appear in the centre of the Screen.
The value pWD ensures that the input given by the user is not
CFillinthe blanks using the words given in the box. displayed.
IMG Fillround POST Hyperlink VSPACE Row
The method in: a <FORM> tag has two options GET and
2. We may display a pictureusing the tag.
The <TR> tag describes each of a table.
4 may be used to specify the amount of space left on the top
and bottom of the image.
5, Around bullet may be specified by the type in the <UL> tag.
Atext that may link to other
sections of the page or website is known as a
D. Answer the following questions.
L. How many types of lists can be created in HTML?
Explain each type and its functionality.
) What is the difference between the type attribute
when used with <0L> and <UL> tags?
3. Name the two types of bullets that may be created.
4. Differentiate between:
(a) cell padding and cell spacing. (b) ROWSPAN and COLUMNSPAN
(c) VSPACE and HSPACE
5. Define the following tags-UL, OL, DL, TR, TD, TH, INPUT, IMG and A.
6. What is the use of HREF? How does it help to link to an external
document and an internal document?
7. Write the general syntax of a form tag. Give one example of an action that can be taken in a
form.
8. Define a control. What are button controls?
9. Give one example each where the following may be usedTEXTFIELD, PASSWORD,
TEXTAREA
RADIO BUTTON,CHECKBOX, SUBMIT and RESET.
10. What alignments are possible with the <IMG> tag? What is the use of the height and width
attributes
while entering an image?
11. How can
one use images to hyperlink?
105
E. Solve the
crossword using the given clues.
Crossword Zone ACROSS
alignment attribute
2. Top tobottom
with the
3. This attribute is presenttable
5. Describes the row of
a IMG tag
7. Helps us to give a name to the
table
9. Bulleted list
4
DOWN
5
6 1. Composed of rows and columns
3. Helps to mention the target file name
8 4. Caption of the table may be aligned here
6. An interactive tag
7. One may span this way to include more
than one column in a table
8. This may be used with lists
1. Design five linked webpages containing tables, images and lists on your favourite topic.
2. Design the visual round of a quiz show. Insert all the images as questions. Hyperlink them Zone
to their answers. Includea back switch to come back to the main page.
106
Lnage
EVENTS
" FEST
" DEBATE
" TALENT HUNT
" QUIZ
" SPORTS
SCHO0L PRIZES
BEST PERFORMING HOUSE
BEST DISCIPLINED HOUSE
BEST HOUSE IN SPORTS
BEST HOUSE IN
ACADEMICS
BEST HOUSE IN
CO-CURRICULAR ACTIVITIES
HOUSE DUTIES
Yellow
January to March
Green
April to June
Red
July to September
Blue
October to December
107