In general terms the phrase “list” refers to a record of short pieces of information arranged in a specific format.The examples of such list may include shopping list, list of names of employees in an organization etc. In HTML we use the concept of lists i.e HTML List so as to display information carrying a specific order.

The HTML supports four types of lists. They are

  1. Unordered List
  2. Ordered List
  3. Miscellaneous or nested List
  4. Definition List

Now let’s define all the above three types of list..

    • Unordered List : If you intent to display certain text on the console, with each independent sentence initiated with a bullet mark then this instance can be achieved by means of a mechanism referred as unordered list.
      Here usually the entire text is enclosed within the tags <ul type=”circle or square or disc”> text to be displayed </ul> with each independent sentence initiating with <li> and closing with </li>. Here type=”value” is an attribute.

      Example snippet: 

      <li> Hello </li>
      <!– Displays the output “Hello” initiated with “disc” bullet –>
      <ul type=”circle”>
      <li> This is</li>
      <!– Displays the output “This is” initiated with “circle” bullet –>
      <li type=”square”>
      <li> an </li>
      <!– Displays the output “an” initiated with “square” bullet –>
      <ul type=”disc”>
      <li> Unordered List. </li>
      <!– Displays the output “Unordered List” initiated with “disc” bullet –>

    • Ordered List: If the sentence is initiating with the Large Roman Number, Small Roman Number, Alphabets including both capital and small letters etc.Then that list is said to be an ordered list.
      Ordered list is initiated using the tags <ol type=”1 or a or A or I or i”> text </ol> with independent sentence starting with <li> and ending with </li>.

      Example snippet:

      <!– Output is Hello beginning with 1 –> 
      <ol type=”A”>
      <!– Output is Hello beginning with A –>
      <ol type=”a”>
      <!– Output is Hello beginning with a –>
      <ol type=”I”>
      <!– Output is Hello beginning with I –>
      <ol type=”i”>
      <!– Output is Hello beginning with i –>
      <ol type=”1″ start=”100″>
      <!– Output is Hello beginning with 100 –>
      Note : If start attribute isn’t declared then by default it starts with 1.

  • Miscellaneous or Nested List : When one list type is included in other list type then such type of succession is usually referred to as Miscellaneous or Nested List.
  • Definition List: It is a special type of HTML list that lists terms and their definition. It is created using <dl> tag. A term in the definition is specified using <dt> tag and its definition is specified using <dd> tag where dl stands for define list, dt stands for define term and dd stand for define definition.

    Example Snippet:

    <dd> A place where you learn things from scratch </dd>

    Output would be like this :
    A place where you can learn things from scratch



1 Comment

Leave A Reply