Understanding HTML
Understanding HTML
Notes By Tanuja Banerjee, Computer teacher St. Anne’s Girls” High School
This chapter in Computer Science deals with HTML–the Hyper Text Mark-up language to
help students understand the concept of the language that’s primarily used for website
development and related aspects.
HTML– The language used to create or design a website is called HTML. It is a
complete code package that allows a user to create web pages. HTML was designed
by Sir Tim Berners Lee in 1989.
Websites- Websites are collection of many web pages which contain text, graphic, video,
audio and link to other web pages via hyperlink. World Wide Web was founded by Tim
Berners-Lee in 1990.
Hyper Text– Hyper text is the text used to link various web pages. It is the text on a web
page, which on clicking opens a new web page.
Mark-up – Mark- up means highlighting text either by underlining, by displaying text in
different colour or both.
Language– Language is mode of communication between web pages.
Tag- A tag is a piece of code which acts as a label that a web browser interprets. It
instructs a web browser what to display and how to display . In simple words we can say
that Tags are the HTML commands written in particular syntax. Most HTML tags exist
in pair- Start Tag <tag> ……… </tag>.
Common HTML tags-
1. HTML tag– This tag informs the web browser that the pages are formatted
in HTML.
Syntax- <HTML> ……. Content of document…… </HTML>
2. HEAD tag- It encloses the document header but contains no text within
itself.
Syntax- <HEAD>……….. </HTML>
3. TITLE tag- This tag is written inside the <HEAD> tag and closed before
</HEAD>. It gives title of the web page displayed on the title bar.
Syntax- <HEAD><TITLE>……. Title of the document….. </TITLE></HEAD>
4. BODY tag – This tag appears just after <HEAD> tag. This tag includes all the
text, images and the formatting elements with their attributes.
Syntax- <BODY>………. Whole content of the page ……. </BODY>
Elements in HTML-
Everything from start tag to end tag is referred to as HTML elements.
Adding Comments– Comments are remarks which are left in a program to increase
readability of the program. Any information written between <!–and — > will not be
considered for processing but is very helpful in understanding at a later date.
FONT tag- Font tags change the appearance of text. It begins with <FONT>
and ends with </FONT>
Tags can have some additional information inside them called attributes.
Various attributes of FONT tag are-
1. Face- It changes the font of the text. Example- <FONT FACE= “Lucida
Handwriting”>
2. Size- It changes the size of the font to be displayed.
Example- <FONT SIZE= “7” >
U (underline) tag- To underline the text enclosed within set the back<U> and </U>
Changing the appearance of background
Background-This attribute is used to set the background of the page by using any image
file.
Example- <BODY BACKGROUND= “C:\HTML\cutebear.jpg”>
The following notes on Computer deals with HTML coding in which the students will
learn about List, creating Table, linking, inserting image and use of different Tags.
Whenever we have to present any information in a precise manner, like list,we use
bullets. HTML supports various elements to create list for displaying items in a specific
order. A list can be defined in different styles, such as- numbers or bullet.
Ordered list
Unordered list
Definition list
ORDERED LIST
The Ordered list is used to display the list of items in a specific order. It is a container
tag which starts with <OL> tag and finishes with </OL> tag. By default , the contents get
displayed with a numbered list item.
<LI> List Item- It is an empty element that does not require a closing tag.
START- This attribute is used to give the starting point of the numbering
order of the list. With START attribute , the value (positive number) must be
given in double quotes. Example- START=”5”, means ordered list will start
from 5.
TYPE- This attribute defines the type of numbering style for the ordered list
items. Example- (A,B,C), (a,b,c), (I,II,III,IV), (I,ii,iii,iv),(1,2,3,4)
Eaxmple of ordered list
Output of the ordered list coding will appear
this way
HTML Coding for Ordered List-
<HTML>
<HEAD>
<TITLE> WELCOME </TITLE>
</HEAD>
<BODY BGCOLOR= “pink” >
<FONT COLOR=”White”> The days of the week
<OL Type= “a” >
<LI> Monday
<LI> Tuesday
<LI> Wednesday
<LI> Thursday
<LI> Friday
<LI> Saturday
<LI> Sunday
</OL>
</FONT>
</BODY>
</HTML>
UNORDERED LIST-
Unordered list is a collection of items that are not to be displayed in any special order or
sequence. It is a container tag which starts with <UL>tag and finishes with </UL> tag
<LI> tag- Each list item in a list has to be preceded by <LI> empty tag.
DEFINITION LIST-
A definition List is used to present a list of definitions for items. It is a container tag
which starts with <DL> and ends with </DL> tag.
Creating a Table in HTML
Tables arrange data in rows and columns and provide an attractive way to represent
information.
Each table begins with <TABLE> tag and ends with </TABLE> TAG.
Each row begins with <TR> (table row) tag and ends with </TR> tag. Rows
must be inside table.
Each row contains many columns, so each column begins with <TH> (table
heading) tag ends with </TH>. Column headings must be inside row.
Each column contains data within the cell, so it begins with <TD> (table
data) tag and ends with </TD>. Cells must be inside rows.
The number of <TD> tags in a single <TR> tag, defines the number of
columns in a single row.
Attributes of Table Tag-
CELLPADDING– It specifies distance between the edge of cell & its contents in pixels
Syntax- <TABLE BORDER=3 BORDERCOLOR=”BLUE” BGCOLOR= “WHITE” ALIGN=
“CENTER” CELLPADING=”10”>
CELLSPACING– It specifies the minimum distance adjacent cells in pixels
Syntax- <TABLE BORDER=3 BORDERCOLOR= “BLUE” BGCOLOR= “WHITE”
ALIGN=”CENTER” CELLSPACING=”10”>
ALIGN –This attribute specifies the alignment of the table on the page.
WIDTH- Specifies the overall height of the table to fit the data in it.
<HTML>
<HEAD>
</HEAD>
<TR>
<TH>S.No.</TH><TH>Name</TH><TH> Grades</TH>
</TR>
<TR>
<TD>1</TD><TD>Bindu</TD><TD>A </TD>
</TR>
<TR>
</TR>
<TR>
</TR>
</TABLE>
</BODY>
</HTML>
HYPERLINKS IN HTML-
While surfing internet , we have seen highlighted words or images on the web pages.
When we click on any of them, it takes us to another web page or part. These links take
us directly to other pages or even to specific parts of a given page are called Hyperlinks.
Hyperlinks–
Hyperlinks allow web users to navigate between websites by clicking on text and
images.
A(anchor) – This tag is used to mark the text as hypertext link, to link one page to
another. Anything written between the opening <A> tag and closing </A> t ag is used as
text of the link. When a user clicks on that link it will reach to the linked document.
Attribute of <A> tag-
SRC- Gives image filename in double quotes with complete path. SRC(Source)
attribute gives the exact and complete location of the image file on the disk,
otherwise the image may not appear on the page.
VSPACE- Adding space around the top and bottom of the image.
HSPACE- Adding space around the left and right of the image.