HTML
HTML
Introduction to HTML
4.1 INTRODUCTION
HTML (Hypertext Markup Language) is used to create document
on the World Wide Web. It is simply a collection of certain key
words called ‘Tags’ that are helpful in writing the document to be
displayed using a browser on Internet.
It is a platform independent language that can be used on any
platform such as Windows, Linux, Macintosh, and so on. To
display a document in web it is essential to mark-up the different
elements (headings, paragraphs, tables, and so on) of the
document with the HTML tags. To view a mark-up document,
user has to open the document in a browser. A browser
understands and interpret the HTML tags, identifies the structure
of the document (which part are which) and makes decision about
presentation (how the parts look) of the document.
HTML also provides tags to make the document look attractive
using graphics, font size and colors. User can make a link to the
other document or the different section of the same document
by creating Hypertext Links also known as Hyperlinks.
4.2 OBJECTIVES
After going through this lesson, you would be able to :
72 :: Certificate in Web Designing
l <HTML>.............</HTML>
l <HEAD>.............</HEAD>
l <BODY>.............</BODY> Starting
Tag
The <HTML> tag encloses all other HTML tags and associated text
within your document. It is an optional tag. You can create an
HTML document that omits these tags, and your browser can still
read it and display it. But it is always a good form to include the
start and stop tags.
<HTML>
Your Title and Document (contains text with HTML tags) goes here
</HTML>
Most HTML tags have two parts, an opening tag and closing tag.
The closing tag is the same as the opening tag, except for the slash
Introduction to HTML:: 73
mark e.g </HTML>. The slash mark is always used in closing tags.
<HTML>
<HEAD>
.............
.............
.............
</HEAD>
<BODY>
.............
.............
.............
Closing
</BODY> Opening
Tag Tag
</HTML>
<HEAD>
<TITLE>
Your title goes here
</TITLE>
</HEAD>
74 :: Certificate in Web Designing
The BODY tag contains all the text and graphics of the document
with all the HTML tags that are used for control and formatting
of the page.
<BODY>
</BODY>
<HTML>
<HEAD>
<TITLE>
My first Page
</TITLE>
</HEAD>
<BODY>
WELCOME TO MY FIRST WEB PAGE
</BODY>
</HTML>
Introduction to HTML:: 75
Example:
<BODY BGCOLOR="yellow">
</BODY>
Example:
<BODY TEXT="red">
Introduction to HTML:: 77
</BODY>
Example:
<BODY LEFTMARGIN="60">
</BODY>
Example:
<BODY TOPMARGIN="60">
</BODY>
Example:
<BODY BACKGROUND="[Link]">
</BODY>
<HTML>
<HEAD>
<TITLE>
Use of Attributes with the Body Tag
</TITLE>
</HEAD>
<BODYBACKGROUND="[Link]" text="blue"
TOPMARGIN ="75"
LEFTMARGIN="75">
Your document text will be indented 75 pixels from the
left hand and 75 pixels from the top of the page. The
background image [Link] will be tiled across the
document. Your image and HMTL document should
present at the same place.
</BODY>
</HTML>
Example:
INTEXT QUESTION
1. Write True or False for the following:
<HTML>
<HEAD>
<TITLE>
Section Heading
</TITLE>
</HEAD>
<BODY>
<H1> This is Section Heading 1 </H1>
<H2> This is Section Heading 2 </H2>
<H3> This is Section Heading 3 </H3>
<H4> This is Section Heading 4 </H4>
<H5> This is Section Heading 5 </H5>
<H6> This is Section Heading 6 </H6>
</BODY>
</HTML>
Introduction to HTML:: 81
Generally you press enter when you want to create line and
paragraph breaks, but they won’t show up when you view
the document in browser.
Example:
Output:
Here, two paragraphs are separated with a line. But web browser
ignores the line breaks in the second paragraph that can be
controlled by putting <BR> tag.
Example:
<BODY>
National Institute of Open Schooling <BR>
B-31B, Kailash Colony <BR>
New Delhi-110048
</BODY>
Output:
Example:
<PRE>
National Institute of Open Schooling
B-31B, Kailash Colony
New Delhi-110048
</PRE>
Output:
<HTML>
<HEAD>
<TITLE>
Use of Paragraph, Line break and preformatted text Tag
</TITLE>
</HEAD>
<BODY>
HTML Tutorial
<P>
HTML stands for Hypertext Markup Language
It is used for creating web page. It is very simple
and easy to learn.
</P
<P>
84 :: Certificate in Web Designing
Fig. 4.5
Introduction to HTML:: 85
Example:
<BODY>
</BODY>
Output:
By using <FONT> Tag one can specify the colors, size of the
text.
Ø COLOR: Sets the color of the text that will appear on the
screen. It can be set by giving the value as #rr0000 for red
Introduction to HTML:: 87
<HTML>
<HEAD>
<TITLE>
Use of Character Formatting Text Tags
</TITLE>
</HEAD>
<BODY>
<H1><I> Welcome to the world of Internet</I></H1>
It is a
<FONT COLOR="BLUE" SIZE="4">
<U>Network of Networks</U>
</FONT>
</BODY>
</HTML>
88 :: Certificate in Web Designing
Symbols Entity
©, ® ©, ®
¼, ½, ¾ ¼, ½, ¾
÷, <, >, ≤,≥ ÷, <, >, &le, &ge
& &
♣♠♥ &spades, &clubs, &hearts
Example: <PRE>
The copyright symbol is: ©
The registered rank is: ®
</PRE>
Introduction to HTML:: 89
<HTML>
<HEAD>
<TITLE>
An Ordered List
</TITLE>
</HEAD>
<BODY>
<H1><U> Various Terms Used In Internet</U></H1>
<OL>
<LI> WWW-World Wide Web
<LI> URL-Uniform Resource Locator
<LI> HTTP-Hypertext Transfer Protocol
<LI> FTP-File Transfer Protocol
<LI> HTML-Hypertext Markup Language
</OL>
</BODY>
</HTML>
90 :: Certificate in Web Designing
Attribute Description
Type = A Capital letter eg. A, B, C………
Type = a Small letter eg. a, b, c,………
Type = I Uppercase Roman Numbers eg. I, II, III……
Type = i Lowercase Roman Numbers eg. i, ii, iii……
Type = 1 eg. 1, 2, 3………….
Introduction to HTML:: 91
Ø START: used for lists that need to start at values other than
1. START always specified in default numbers, and is
completed based on TYPE before display, For example, If
START =5 it would display either an ‘E’, ‘e’, ‘V’, ‘v’, or ‘5’
based an TYPE attribute.
One ordered list might contain one or more ordered list that is
called as Nested Order lists.
<HTML>
<HEAD>
<TITLE> Use of Nested Ordered Lists</TITLE>
</HEAD>
<BODY>
<OL TYPE = A START =3>
<LI> Fruits
<OL TYPE = I>
<LI> Apple
<LI> MANGO
<LI> Orange
</OL>
<LI> VEGETABLES
<OL TYPE = I>
<LI> Brinjal
<LI> Cabbage
<LI> Tomato
</OL>
</OL>
</BODY>
</HTML>
92 :: Certificate in Web Designing
<HTML>
<HEAD>
<TITLE> Use of Unordered List </TITLE>
</HEAD>
<BODY>
<UL>
<LI> FRUITS
<UL>
Introduction to HTML:: 93
<LI> Apple
<LI> Mango
<LI> Orange
</UL>
<LI> VEGETABLE
<UL>
<LI> Brinjal
<LI> Cabbage
<LI> Tomato
</UL>
</UL>
</BODY>
</HTML>
The unordered list also used the attributes COMPACT and TYPE
= CIRCLE or DISC (filled Circle used as a bullet)
94 :: Certificate in Web Designing
INTEXT QUESTION
2. Write True or False for the following:
It is an empty tag (only start tag, no end tag) and is written as:
If the location of the image and web page are in the same place
in the same directory/path then it is simply written <IMG
SRC=[Link]>
l ALIGN = TOP - Aligns the text with the top of the image
<HTML>
<HEAD>
<TITLE> Use of IMG Tag With its ALIGN Attribute</TITLE>
</HEAD>
<BODY>
<P>
<IMG SRC=[Link] ALIGN=TOP>
Aligns the text with the Top of the image
</P>
<P>
<IMG SRC=[Link] ALIGN=MIDDLE>
Aligns the text with the Middle of the image
</P>
<P>
<IMG SRC=[Link] ALIGN=LEFT>
Displays image on left side and the subsequent text flows
around the right hand side of that image. Displays image
on left side and the subsequent text flows around the
right hand side of that image. Displays image on left side
and the subsequent text flows around the right hand side
of that image.
</P>
<P>
<IMG SRC=[Link] ALIGN=RIGHT>
</HTML>
Introduction to HTML:: 97
BORDER
Border around the image can be controlled by using BORDER
attribute of <IMG> tag. By default image displays with a thin
border. To change the thickness or turn the border off, the value
in pixels should set to BORDER attribute.
Example:
OR
Example:
This link text jumps to the section named with HREF on click.
The # symbol before the section name is must.
Example:
A different server:
<A HREF="[Link]
#section_name>
<HTML>
<HEAD><TITLE> Use of Anchor Tag</TITLE></HEAD>
<BODY>
<H2 align=''center''><U><FONT COLOR=''BLUE''>National Institute of Open
Schooling</FONT> </U></H2>
<A HREF=''[Link] SRC=''[Link]'' alt=''NIOSLOGO''
align=''left''></A>
The success of open learning and distance education very much depends on
the harnessing of the new and latest technology. The emerging Internet and
Web Technology helps in effective dissemination of information. The web site is
a demand source of latest information. One can access NIOS website by
clicking on <A
HREF="[Link] >[Link] OR on Clicking
NIOS logo <p></p><p></p><p></p><p></p>
<p><b><i><u>Internet and Web Technology</u></i></b></p>
<p><FONT COLOR="BLUE">Various Terms used in Internet are:</FONT>
<br>
</BODY>
</HTML>
INTEXT QUESTION
3. Fill in the blanks:
(a) HTML _____________ a web page to include an image.
(b) Web pages are linked to another through__________
links.
(c) _______________ tag is used to add images to HTML
documents.
(d) Border around the image can be controlled by using
___________ attribute of image tag.
[Link] respectively.