Lists

When structuring HTML documents lists play a major role. Mainly lists used in HTML documents can be divided into two, namely ordered list and unordered lists. Ordered list refers to list where a number or a letter is used to order a list and unordered list refers to lists where a bullet is used to order a list.

<ul></ul> used as the element to create an unordered list and <ol></ol> is used to create ordered lists. Whether it is an ordered list or an unordered list to include list items <li><li> element is used.

Creating an ordered list


An ordered list is below. We use numbers to ordered lists.

1.First item

2.Second item

3.Third item


 With ordered list “type “attribute can be used to set the number format. Possible values are “1”, “a”, “A”, “i”, and “I”.

Eg: <ol type=”A”>

Creating an Unordered List.

In unordered list there is no order. We use Bullets in unordered lists.Type attribute is also used with unordered lists. Possible values for this attribute are “circle”, “square” and “disc”.
Eg: <ul type="circle">


Nested lists

List can be nested whether they are ordered lists or unordered lists. When nesting the new list, it should contain within a <li> element.
Eg:





Definition Lists

Definition lists are useful when having to list down a long list of definitions. Thought the structure of definition lists are similar to ordered and unordered lists, the elements used are different. Here <dl> is used to notify the presence of a definition list. The definition term is given by <dt> and the definition (or description) is given by <dd>.


No comments:

Post a Comment

I know how time is important to you, But your comment will help us to develop this site....