|
Search This Site
|
Using Lists in HTML
Lists are classified as being ordered, unordered or definition, each of which are discuessed below.
A list item specifies something as belonging to a particular list.
Each list item is created by use of the <li> tag. Ordered ListsAn ordered list is one whereby the items of that list are displayed in some unique way. Items can be listed by numbers (e.g. 1, 2, 3), roman numerals ( e.g. i, ii, iii) or even letters (e.g. a, b, c). An ordered list is defined by the <ol> tag. The type attribute specifies how our list should be displayed. By default (if we do not specify a type), list items are displayed using numbers. The example below lists three (3) items in an ordered fashion using common letters: <ol type="a"> <li> Flowers </li> <li> Trees </li> <li> Bees </li> </ol>
Unordered ListsUnordered lists are displayed in no particular format. They have no numbers or letters for list items. Instead, they are displayed by bullets hence the name unordered applies. Unordered lists are defined by the <ul> tag. Example of an unordered list of food items: <ul> <li> Banana Chips </li> <li> Chicken Back</li> <li> White Rice </li> <li> Carrots </li> <li> Grapes </li> </ul> There is no type definition in unordered lists. Do you understand the difference ? Definition ListsA definition list defines a description of a list item. A definition list starts with the <dl> (definition list) tag. The list item is placed beween a <dt> (definition term) tag and the description is placed between a <dd> (definition description) tag. Below 3 terms are described: <dl> <dt> School </dt> <dd> A place of learning </dd> <dt> HTML </dt> <dd> Hyper Text Markup Language - a set of tags and rules used in the development of web pages </dd> <dt> New2HTML </dt> <dd> One of the best web tutorial websites around developed to bring forth an undertstanding of HTML and CSS </dd> </dl> Practise Excercise Produce the list of supermarket items below.
Previous Lesson - Paragraphs
Next Lesson - Links
|
|
© Copyright 2010 | All Rights Reserved
|