Web Technologies - Old Questions

7.  What are the attributes of list tag? Explain.

5 marks | Asked in 2068

HTML supports ordered, unordered and definition lists.

  • <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.
  • <dl> − A definition list. This arranges your items in the same way as they are arranged in a dictionary.

By default, unorder list will list the items with it disc. We can use type attribute for <ul> tag to specify the type of bullet we like. Following are the possible options −

  • <ul type = "square">
  • <ul type = "disc">
  • <ul type = "circle">
E.g. 
<!DOCTYPE html>
<html>
   <head>
      <title>HTML Unordered List</title>
   </head>
   <body>
      <ul type = "square">
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ul>
   </body>
</html>

In ordered list we can use type attribute for <ol> tag to specify the type of numbering we like. By default, it is a number. Following are the possible options −
  • <ol type = "1"> - Default-Case Numerals.
  • <ol type = "I"> - Upper-Case Numerals.
  • <ol type = "i"> - Lower-Case Numerals.
  • <ol type = "A"> - Upper-Case Letters.
  • <ol type = "a"> - Lower-Case Letters.
E.g. 
<!DOCTYPE html>
<html>
   <head>
      <title>HTML Ordered List</title>
   </head>
   <body>
      <ol type = "A">
         <li>Ginger</li>
         <li>Potato</li>
         <li>Radish</li>
      </ol>
   </body>
</html>