Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 18, 2022 11:41 am GMT

Html lists

HTML lists are used to group together related pieces of information. All lists may contain one or more list elements. There are three different types of HTML lists:

  1. - Unordered List - bulleted List <ul>
  2. - Ordered List - numbered List <ol>
  3. - Description List - definition List <dl>

HTML Unordered Lists - An unordered list is a collection of related items that have no special order. The Unordered list starts with <ul> tag and list items start with the<li> tag. Each item in the list is marked with a bullet.

<ul>   <li>Michael</li>   <li>Pamela</li>   <li>Dwight</li>  </ul>

HTML Ordered Lists - In the ordered HTML lists, all the list items are marked with numbers by default. It is known as numbered list also. The ordered list starts with <ol> tag. The numbering starts at one and is incremented by one for each list element tagged with <li>.

<ol>   <li>Angela</li>   <li>Oscar</li>   <li>Kevin</li>  </ol>

The type attribute for <ol> tag is used to specify the type of numbering you want to use:

<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.

HTML Description Lists - A description list is a list of terms, with a description of each term.

<dl> - defines a description list
<dt> - defines a term in a description list
<dd> - describes the term in a description list

Example:

<dl>  <dt>Michael</dt>  <dd>- world's best boss</dd>  <dt>Pam</dt>  <dd>- the office receptionist</dd></dl>

Original Link: https://dev.to/jolamemushaj/html-lists-17oc

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To