html-lists-ordered-unordered-and-links.ppt

likhithareddymedapal 153 views 21 slides Dec 14, 2023
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

html lists and links


Slide Content

LISTS AND LINKS
Explained By:
SarbjitKaur.
Lecturer, Department of Computer Application,
PGG.C.G., Sector: 42, Chandigarh

INTRODUCTION TO LISTS
Listsarethebestwaytoprovideinformation
inastructured,easy-to-readformat.Theyhelp
tovisitoreasilyspotinformation,andthey
drewattentiontoimportantinformation.
listsarethebestmethodof
oranganizginformationandpresentingitina
structuredfashion.

TYPES OF LISTS
There are three kinds of lists:
•Ordered List (Numbered List)
•Unordered List (Bulleted List)
•Definition Lists

Ordered List (Numbered List)
•Ordered list also called as Numbered list, is
used to present a numbered list of item in the
order of importance or the item(paragraph) is
marked with a number.
•An ordered list must begin with the <OL>
followed by an <LI>list item tag.

Example: An HTML document orderedList.html shows
the use of Ordered List
<HTML>
<HEAD>
<TITLE>
An Ordered List
</TITLE>
</HEAD>
<BODY>
<ol>
<li>Coffee>
<li>Milk
<li>Tea
<li>sugar
</ol>
</OL>
</BODY>
</HTML>

Output
1.Coffee
2.Milk
3. Tea
4. sugar

Attributes of <OL> tag
•COMPACT: render a list in compact form.
•TYPE : allows marking list items with different types.
By default the list Item markers are set to numbers
1,2,3… so on.Othervalues of TYPE attribute are:
•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……

Attributes of <OL> tag
•The start attribute: The attribute is used to override default
list numbering when a list is divide into multiple parts. E.g:
<HTML>
<HEAD>
<TITLE>
An Ordered List
</TITLE>
</HEAD>
<BODY>
Impact printers
<ol>
<li>DOT MATRIX

EXAMPLE OF START ATTRIBUTE
<li>CHAIN PRINTER
<li>DRUM PRINTER
</ol>
<P>NON-IMPACT PRINTER</P>
<OL START=4>
<li>LASER PRINTER
<li>ELECTROSTATIC PRINTER
</OL>
</BODY>
</HTML>

OUTPUT
Impact printers
1.DOT MATRIX
2.CHAIN PRINTER
3.DRUM PRINTER
NON-IMPACT PRINTER
4.LASER PRINTER
5.ELECTROSTATIC PRINTER

Nested Order List
•OneorderedlistmightcontainoneormoreorderedlistthatIscalledasNested
Orderlists.
•Example:AnHTMLdocumentnested.htmlshowstheuseofNestedOrderLists
withattributes:
<HTML>
<HEAD>
<TITLE>UseofNestedOrderedLists</TITLE>
</HEAD>
<BODY>
<OLTYPE=ASTART=3>
<LI>Fruits
<OLTYPE=I>
<LI>Apple
<LI>MANGO
<LI>Orange
</OL>

Example: An HTML document nested.html shows the use of
Nested Order Lists with attributes
•<LI>VEGETABLES
•<OLTYPE=I>
•<LI>Brinjal
•<LI>Cabbage
•<LI>Tomato
•</OL>
•</OL>
•</BODY>
•</HTML>

Unordered List <UL>
•UnorderedListalsocalledasbulletedlist,
usedtopresentlistofitemsmarkedwith
bullets.Anunorderedliststartswithin<UL>
followedby<LI>(ListItem)tag.Useof<UL>is
verysimilarto<OL>(orderedlist).

Use of Unordered List and Various
Attributes
<HTML>
<HEAD><TITLE> Use of Unordered List </TITLE>
</HEAD>
<BODY>
<UL>
<LI> FRUITS
<UL>
<LI> Apple
<LI> Mango
<LI> Orange
</UL>
<LI> VEGETABLE
<UL>
<LI> Brinjal
<LI> Cabbage
<LI> Tomato
</UL>
</UL>
</BODY>
</HTML>

OUTPUT
•FRUITS
--Apple
-Mango
-Orange
•VEGETABLE
-Brinjal
-Cabbage
-Tomato

Definition Lists
•Adefinitionlistisalistofitems,witha
descriptionofeachitem.The<dl>tagdefinesa
definitionlist.The<dl>tagisusedinconjunction
with<dt>(definestheiteminthelist)and<dd>
(describestheiteminthelist):E.g.
•<dl>
<dt>Coffee</dt>
<dd>-black hot drink</dd>
<dt>Milk</dt>
<dd>-white cold drink</dd>
</dl>

OUTPUT
•Coffee
-black hot drink
•Milk
-white cold drink

INTRODUCTION HTML Hyperlinks (Links)
•Ahyperlink(orlink)isaword,groupofwords,orimagethatyou
canclickontojumptoanewdocumentoranewsectionwithinthe
currentdocument.WhenyoumovethecursoroveralinkinaWeb
page,thearrowwillturnintoalittlehand.
•HTMLprovides<A>AnchorTagtocreatelinks.Theformatofusing
anchortagisasfollows:
<AHREF="URL">MakeMeTheLink</A>
HREF(HyperLinkReference)isamandatoryattributeused
torefertheURLoftheresource.URL(UniformResourceLocator)is
anaddresstellsthebrowseraboutthefiletolinkto.Itidentifiesfile
locations(Addresses)ontheweboronthelocalharddrive.These
addressescanbethoseofHTMLdocumentsorelementssuchas
images,scripts,appletsandotherfiles.Itisalwaysenclosedin
quotes.

HTML Link Syntax
•The HTML code for a link is simple. It looks like
this:
•<a href="url">Link text</a>
•The href attribute specifies the destination of a
link.
•Example:
•<a href=“http://www.flowers.com/”>
flowers</a>which will display like this:flowers
•Clicking on this hyperlink will send the user to
flowers. COM' homepage

Linking a text to a web site / an external document
•Example:
<A HREF ="http://www.nios.ac.in">Link to Website of NIOS</A>
OR
<A HREF="http://www.nios.ac.in/offices.htm">Links to Contact Us page of NIOS</A>
Opening Address of the document Link text Closing Anchor Tag
Anchor Tag
Intheaboveexamplethelinktext“LinkstoContactUspageof
NIOS”wouldappearunderlinedandinacolordifferentfromany
othertextinthedocumenttodistinguishalinkfromnormaltext.
Alsoyouwouldfindthatthemousepointerchangesintoahand
likesymbolwhentakenoverthehyperlink.

Linking (jumping) to a specific place within the same
document.
•Sometimes, it is required to jump different sections
in the same document. For this it needs two steps,
first; identify section with a name and or second; use
jumps to the location using the name used.
•The syntax is:
<A HREF="#section_name"> link to another section of
the same document </A>
•This link text jumps to the section named with HREF
on click.The # symbol before the section name is
must.
Tags