×

HTML Lists

HTML List

HTML lists are used to specify data sets. All lists can include one or more elements from the list. HTML lists are available in three different types:

  • Ordered List or numbered List (ol)
  • Unordered List or Bulleted List (ul)
  • Description List or Definition List (dl)

Ordered List or numbered List

All list items in the ordered HTML lists are marked with numbers by default. It is also known as a numbered list. The ordered list starts with the < ol > tag and the list item starts with the < li > tag.

Example

<html> 
<body> 
<ol>
<tr> Fruits name </tr>
 <li>Apple</li> 
 <li>Banana</li> 
 <li>Orange</li> 
 <li>Papaya</li> 
</ol> 
</body>
</html> 

Output

HTML Lists

HTML Unordered List or Bulleted List

All the list items are marked with bullets in the HTML Unordered list. It is also referred to as a bulleted list. The Unordered list starts with the < ul > tag. The < li > tag starts with the list item.

Example

<html> 
<body> 
<ul>
<tr> Fruits name </tr>
 <li>Apple</li> 
 <li>Banana</li> 
 <li>Orange</li> 
 <li>Papaya</li> 
</ul> 
</body>
</html> 

Output

HTML Lists

HTML Description List or Definition List

HTML Description list is also a list style that is supported by HTML and XHTML. It is referred as a definition list where the entries are listed as a dictionary or encyclopedia.

The definition list is useful when we want to present a glossary, a list of terms or another name-value list.

The HTML definition list contains three tags:

<dl> tag: Defines the starting of the list.

<dt> tag: Defines a term.

<dd> tag: Defines the term definition(description).

Example

<html>
   <head>
      <title>HTML Definition List</title>
   </head>
   <body>
      <dl>
         <dt><b>HTML</b></dt>
         <dd>This stands for Hyper Text Markup Language</dd>
         <dt><b>HTTP</b></dt>
         <dd>This stands for Hyper Text Transfer Protocol</dd>
      </dl>
   </body>
</html>

Output

HTML Lists

HTML Nested List

A list within another list is called a nested list. If you want a bullet list inside a numbered list, this type of list will be called a nested list.

Example

<html>
<head>
            <title>Nested list</title>
</head>
<body>
            <p>List of Indian States with thier capital</p>
<ol>
            <li>Delhi
                        <ul>
                                    <li>NewDelhi</li>
                        </ul>
            </li>
            <li>Haryana
                        <ul>
                                    <li>Chandigarh</li>
                        </ul>
            </li>
            <li>Gujarat
                        <ul>
                                    <li>Gandhinagar</li>
                        </ul>
            </li>
            <li>Rajasthan
                        <ul>
                                    <li>Jaipur</li>
                        </ul>
            </li>
            <li>Maharashtra
                        <ul>
                                    <li>Mumbai</li>
                        </ul>
            </li>
            <li>Uttarpradesh
                        <ul>
                                    <li>Lucknow</li></ul>
            </li>
</ol>
</body>
</html>

Output

HTML Lists

HTML Unordered List or HTML Bulleted List

The HTML Unordered List or Bulleted lists can display bulleted items. We can use an unordered list to display the items in any random order. The HTML ul tag is used in the unordered list.

There may be 4 types of bulleted list:

  • disc
  • circle
  • square
  • none

There are 4 types of attributes in the < ul > tag to represent different ordered lists.

TypeDescription
“disc”It's the default style. In this style, the items of the list are marked with bullets.
“circle”The items in the list are marked with circles.
“square”The list items in the list are marked with squares.
“none”The list items are not marked here.

Unordered List Example

<html> 
<body> 
<ul> 
 <li>HTML</li> 
 <li>Java</li> 
 <li>JavaScript</li> 
 <li>SQL</li> 
</ul>  
</body> 
</html> 

Output

HTML Lists

ul type="disc"

Example

<html>
<body>
<h2>Unordered List with Disc Bullets</h2>
<ul style="list-style-type:disc;">
  <li>HTMLee</li>
  <li>Java</li>
  <li>JavaScript</li>
</ul> 
</body>
</html>

Output

HTML Lists

ul type="circle"

<html>
<body>
<h2>Unordered List with Circle Bullets</h2>
<ul style="list-style-type:circle;">
  <li>HTML</li>
  <li>Java</li>
  <li>JavaScript</li>
</ul> 
</body>
</html>

Output

HTML Lists

ul type="square"

Example

<html>
<body>
<h2>Unordered List with Square Bullets</h2>
<ul style="list-style-type:square;">
  <li>HTML</li>
  <li>Java</li>
  <li>JavaScript</li>
</ul>
</body>
</html>

Output

HTML Lists

ul type="nono"

Example

<html>
<body>
<h2>Unordered List without Bullets</h2>
<ul style="list-style-type:none;">
  <li>HTML</li>
  <li>Java</li>
  <li>JavaScript</li>
</ul> 
</body>
</html>

Output

HTML Lists

HTML Description List | HTML Definition List

HTML Description List or Definition List shows elements like a dictionary in description form. The < dl >, < dt > and < dd > tags are used to define the set of descriptions.

There are three types of description list tags given below:

  • <dl>tag: Defines the list of definitions.
  • <dt>tag: Defines data term.
  • <dd>tag: Defines data definition (description).

Example

<html> 
<body> 
<dl> 
  <dt>HTML</dt> 
  <dd>is a markup language</dd> 
  <dt>Java</dt> 
  <dd>is a programming language and platform</dd> 
 <dt>JavaScript</dt> 
 <dd>is a scripting language</dd> 
  </dl> 
</body> 
</html> 

Output

HTML Lists

Related Topics

HTML <sup> Tag

The HTML sup element is used to describe one or more superscript contents. The sup tag shows a text which is presented above the regular line and half the length...

2 minutes read.

HTML Elements

An HTML element is nothing but a starting tag and then some content and then the closing tag. So we can say HTML elements is everything from the starting tag...

3 minutes read.

HTML SVG

HTML SVG: SVG stands for Scalable Vector Graphics which defines the graphics for the web. It is a language for describing 2-D graphics in XML. Each drawn shape in SVG is...

1 minute read.

HTML <video> Tag

The Video tag in HTML is used to play video on a media player on the web page. We can also insert an audio by the video tag, but audio...

6 minutes read.

HTML5 Attribute

HTML Attribute HTML attributes are special words that provide additional information about the HTML element or attributes.The element or tags have attributes, which define the element's behavior.It also adds attributes with a start...

3 minutes read.

HTML <svg> tag

SVG is used to determine the vector-based graphics in XML format. What is SVG? We utilize SVG tag to specify visuals for the website. The attribute of SVG in a HTML document...

2 minutes read.

HTML Hide Element

The HTML hide element is used to hide the element. We place the hidden attribute inside those elements which we want to hide. The hidden attribute is a Boolean attribute. The...

3 minutes read.

Html &lt;dd> Tag

In an HTML description list, an item's definition or description is indicated using the definition description ("dd" tag). A <dd> tag can contain paragraphs, line breaks, images, links, and lists. It...

4 minutes read.

Html &lt;datalist >Tag

The autocomplete feature in HTML files is provided by the <datalist> tag. It can be used in conjunction with an input tag to enable users to quickly fill out form...

4 minutes read.

HTML <strike> tag

The HTML <strike> tag is used to specifies strikethrough text. The tag is deprecated now and <del> tag is used in HTML files instead of it. All the global and...

2 minutes read.

HTML Layouts

HTML Layouts HTML templates provide a way for well-managed, well-structured responsive web pages to be organized. We could say that the HTML layout specifies how web pages can be set up....

4 minutes read.

Difference between HTML and DHTML

Introduction to HTML HTML stands for Hypertext Markup Language. It is a standard web language used to create web pages and applications. HTML is used to define the structure and content...

4 minutes read.

HTML <u> tag

Underline Element/Tag: The u tag in html is used to specify the important text or phrase by underline. In earlier HTML versions, this element was known as the "Underline" element, and...

5 minutes read.

HTML Date

The input element in HTML has several attributes. One of its attributes is the type attribute which creates a calendar in an order that a user can select a date...

5 minutes read.

HTML Lists

HTML List HTML lists are used to specify data sets. All lists can include one or more elements from the list. HTML lists are available in three different types: Ordered List or...

4 minutes read.

HTML Button Disabled

The HTML <button> element has many attributes, one of them is the disabled attribute. The button on which you apply the disabled attribute will not work, or we can say...

4 minutes read.

HTML Form Input Types

HTML Form Input Types An important element of the HTML form is < input type= "> in HTML. The type attribute of the input element can be of different types, which...

8 minutes read.

HTML Event Attributes

HTML Event Attributes If a browser responds to the user behavior, an event is called. For example, if we click on the submit button, a box of details will appear on...

4 minutes read.

How to change text color in HTML

Changing the text colour of a web page is essential because it enhances readability. There are several ways to change the colour of the text in HTML, which are as follows: Text...

7 minutes read.

HTML <table> tag

The Table element If we want to show the data and information in a two-dimensional table with rows and columns, then we can achieve this by using the HTML element <table>. Syntax: <body> <table> <thead> <tr> <thcolspan="#">………….</th> </tr> </thead> <tbody> <tr> <td>……….</td> <td>……….</td> </tr> </tbody> </table> </body> Example: <!DOCTYPE...

9 minutes read.