|
|
HTML coding - HTML ListsWe all understand the importance of lists in everyday life. They are an indispensable tool for cataloging and indexing various objects and events. Two kinds of lists are very common and used by us regularly. The Ordered Lists help us keep an organized inventory wherein the list items are ranked while in Unordered lists, the classification is not important and the list items do not occur in any assorted order. HTML provides us with 5 different kinds of lists out of which 3 are routinely used. These lists are block-formatting elements that define a block structure and help in a logical layout of the document. The five lists are:
ORDERED LIST <OL> <LI>Item One <LI>Item Two <LI>Item Three <LI>Item Four </OL> The code above is displayed by the browser as
You would have noticed that the list items show some indentation on the left and some space is inserted before and after the list. This makes the reading of the list easy and helps it to stand out from the other text. An ending tag for a list item </LI> is not required. Numbers are the default bullets in ordered lists but you can change this using the TYPE attribute of <OL> tag. This attribute takes one of the five values:
Thus, <OL TYPE="A"> <LI>Item One <LI>Item Two <LI>Item Three </OL> is displayed as
Another attribute is COMPACT (without any value) but is generally ignored by the browsers. UNORDERED LIST <UL> <LI>Item One <LI>Item Two <LI>Item Three <LI>Item Four </UL> is displayed as
Using TYPE="square" on the list above will result in
DEFINITION LISTS <DL> <DT>webdevelopersnotes.com <DD>A great place to learn web development. <DT>fontmagic.com <DD>One of the largest font sites on the Internet. </DL> will be shown by the browser as:
Note that the definitions are indented. Since <MENU> and <DIR> are seldom used and not well supported by browsers, I shall not be discussing them. Now play with the code:
Page contents: Html coding - learning coding in html online free - creating lists on web page - html lists - coding html
Page URL: http://www.webdevelopersnotes.com/tutorials/html/ html_coding_html_lists.php3
|
|