×

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 <samp> tag

The Samp tag in HTML is used for defining the sample output from the computer program. This tag is a phrase type tag and a container tag that means the...

2 minutes read.

HTML Code Tag

The code tag in HTML is a phrase tag used to insert a piece of computer programming code. In HTML there is a separate tag named as <code> tag. Sometimes,...

3 minutes read.

How to change font in HTML

To give style to the content of your website, you may change the font of the text and make your website look attractive to the user. There are several methods which...

4 minutes read.

HTML Video

HTML VIDEO: HTML5 has introduced the <video> tag to embed video into the webpage directly without using the plug-ins.   Syntax: <video attributes >     <source src="address" type="video/mp4">     Your browser does not support the video tag.   </video> <video width="320" height="240" controls>     <source src="mountain.mp4" type="video/mp4">     Your browser does not support the video tag.   </video> Output: ← Prev ...

1 minute read.

Html <colgroup> Tag

A HTML table's column group is specified by the "colgroup" tag. If you want to apply various properties to one or more <col> elements in an HTML table, then you...

4 minutes read.

Html &lt;Col> Tag

You can write the col tag inside the table tag after the thead, tbody, foot, and tr tags. You can also apply it after the caption tag (in which the...

4 minutes read.

HTML Paragraphs

In html, there are some elements which starts with new line and one of them is paragraph. Which is said to be a block of text. In html <p> tag...

4 minutes read.

HTML Tutorial

Introduction This HTML tutorial helps beginners and professionals to learn HTML easily. HTML is a widely used web technology for website development. It stands for Hyper Text Markup Language. It is mainly used to...

7 minutes read.

How to insert image in HTML

An image (technically digital image) in HTML or even in general technical aspects is a binary representation of visual information. By visual information we mean, in the form of drawings/pictures,...

5 minutes read.

HTML Basic Tags

Heading Tags: This tag represents the document header. It is said to be a good practice if every document starts with Heading. Heading tags ranges from H1 to H6 i.e....

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

How to append HTML code to a div using JavaScript?

In HTML, we have a div tag which is used to create a box where we can put a lot of other tags. So it works like a container. So,...

4 minutes read.

HTML <source> tag

For media attributes, such as <video> tag, <audio> tag, and <picture> tag, we use the <source> tag in html for adding such type of multiple media html elements in our...

4 minutes read.

HTML Charsets

In this tutorial, we are going to discuss about the charsets in the HTML. The letters, numbers, and several other symbols are shown correctly by the web browser. All of this...

2 minutes read.

HTML <span> tag

The span tag in HTML is used as an inline container element to mark up a specific or special chunk of a text or a section of a page. If you...

2 minutes read.

HTML <select> tag

This tag helps in making the drop-down list on the web page. This is highly used in HTML forms for taking the input from user. You can use the id attribute...

3 minutes read.

HTML Links

It consist of anchor element which is used to create a link between a source anchor and destination anchor. The anchor tag can be embedded between text, image, video or...

2 minutes read.

HTML Audio

HTML AUDIO: HTML5 provides a method to embed the audio file into a webpage by using HTML5. Before HTML5 audio files is used to play on the browser with the help of...

1 minute read.

HTML Code

Before jumping into the topic, let’s understand a common scenario where we have a code snippet in our HTML file. By code snippet, we mean computer code, which is written...

5 minutes read.

Responsive HTML5 and CSS3 Tutorial

Introduction to HTML5 Tutorial HTML5 is the latest and upgraded version of HTML. HTML is a hypertext markup language. Technically, it is not a programming language. It is a markup language. HTML...

17 minutes read.