Html List

    1100551 VIEW 1 0

HTML for specifying lists of information. where lists allow web developers to set of a group of related items in list. Lists must contain one or more list elements.

List are classified into three ways:

  • <ul> An unordered list. This will list items using plain bullets.
  • <ol>  An ordered list. This will use different schemes of numbers to list your items A definition list.
  • <dl> This arranges your items in the same way as they are arranged in a dictionary.

An unordered

An unordered list is a collection of related items that have no special order or sequence. You can use type attribute for <ul> tag to specify the type of bullet you like. By default, it is a disc. Following are the possible options.

<ul type = "square">
<ul type = "disc">
<ul type = "none">
<ul type = "circle">

 

Value Description
disc Sets the list item marker to a bullet (default)
circle Sets the list item marker to a circle
square Sets the list item marker to a square
none The list items will not be marked
<ul>
         <li>Beetroot</li>
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ul>

Following is an example where we used <ul type = "square">

<ul type = "square">
         <li>Beetroot</li>
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ul>

Following is an example where we used <ul type = "circle"> −

<ul type = "circle">
         <li>Beetroot</li>
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ul>

An unordered

HTML ordered listt is created by using <ol> tag. The numbering starts at one and is incremented by one for each successive ordered list element tagged with <li>. You can use type attribute for <ol> tag to specify the type of numbering you like. By default, it is a number.

Type Description
type="1" The list items will be numbered with numbers (default)
type="A" The list items will be numbered with uppercase letters
type="a" The list items will be numbered with lowercase letters
type="I" The list items will be numbered with uppercase roman numbers
type="i" The list items will be numbered with lowercase roman numbers
<li>Beetroot</li>
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ol>

 

Following is an example where we used <ol type = "1">


<ol type = "1">
         <li>Beetroot</li>
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ol>