DEV Community

M Ramavel
M Ramavel

Posted on

HTML LISTS

Unordered List

  • An unordered list starts with the <ul> tag.
  • Each list item starts with the <li> tag.
  • The list items will be marked with bullets (small black circles) by default:

Example:

     `<ul>
      <li>Coffee</li>
      <li>Tea</li>
      <li>Milk</li>
      </ul>`
Enter fullscreen mode Exit fullscreen mode

o/p:

  • Coffee
  • Tea
  • Milk

Ordered List

  • An ordered list starts with the <ol> tag.
  • Each list item starts with the <li> tag.
  • The list items will be marked with numbers by default:

Example:

   `<ol>
    <li>Movie</li>
    <li>Travel</li>
    <li>Sing</li>
   </ol>`
Enter fullscreen mode Exit fullscreen mode

o/p:

  1. Movie
  2. Travels
  3. Sing

Description Lists

  • HTML also supports description lists.
  • A description list is a list of terms, with a description of each term.
  • The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term

Example:

   `<dl>
     <dt>Coffee</dt>
     <dd> black hot drink</dd>
     <dt>Milk</dt>
     <dd> white cold drink</dd>
  </dl>`
Enter fullscreen mode Exit fullscreen mode

o/p:

coffee
   black hot drink
 Milk
   white cold dring
Enter fullscreen mode Exit fullscreen mode

Top comments (0)