List HTML lists allow web developers to group a set of related items in lists. HTML Lists are used to specify lists of information . There are three different types of HTML lists: 1. Ordered List or Numbered List ( ol ) 2. Unordered List or Bulleted List ( ul ) 3. Description List or Definition List (dl)
Unordered List “An unordered list is a collection of related items that have no special order or sequence. “ The Unordered list starts with < ul > tag and list items start with the <li> tag . The list items in unordered lists are marked with bullets. O U T P UT Here's an example: <ul> <li> Chocolate Cake </li> <li> Black Forest Cake </li> <li> Pineapple Cake </li> </ul> Chocolate Cake Black Forest Cake Pineapple Cake
This attribute gives the type of bullets to be used in the list. type = ’disc ’ : Gives default bullet structure/ By Default type = ’square’ : Looks like solid box bullets type = ’circle’ : Gives Hollow box structure Unordered List Attribute
Ordered List “An Ordered list is a collection of related items that have special order or sequence. “ The ordered list starts with < ol > tag and the list items start with <li> tag . The list items in Ordered lists are marked with Numbers. O U T P UT Here's an example: <ol> <li> Chocolate Cake </li> <li> Black Forest Cake </li> <li> Pineapple Cake </li> </ol> Chocolate Cake Black Forest Cake Pineapple Cake
Ordered List Attribute 1. “Type” : the type attribute Sets the numbering type ( type = “type Value” ). Type Value Generated Style Sample Sequence A Capital Letters A,B,C,D……… a Lowercase Letters a,b,c,d………. I Capital Roman Numerals I,II,III,IV…….. i Lowercase Roman Numerals i,ii,iii,iv 1 Arabic Numberals 1,2,3,4………
Description List “A description list is a list of items with a description or definition of each item .” HTML definition list has 3 tags: 1. <dl > tag represents the description list 2. < dt > tag defines the term 3. < dd > tag describes each term
Bread C o ffee A baked food made of flour. A drink made from roasted coffee beans . <dl> <dt> Bread </dt> <dd> A baked food made of flour. </dd> <dt> Coffee </dt> <dd> A drink made from roasted coffee beans. </dd> </dl> Output Example