HTML List full tutorial with programming example.
![HTML Studymuch.in](https://studymuch.in/wp-content/uploads/2021/12/HTML-Tutorial-9.jpeg)
HTML TUTORIAL (PART-9)
HTML List
HTML list are use to represent listed important information; it can be used our website to make navigation list menu etc.
HTML list can be used to group a collection if items with and without order.
In HTML, list is used to perform important data point by point and it easy to understand, it also used to specify information list by list.
HTML List Elements
Element |
Functions |
<ul> | It is defining an unordered list, where the order is meaningless and it is bulleted. |
<ol> | It is defining an ordered list, where the order is meaningful and it is numbered. |
<li> | It is common element on both <ul> and <ol>, It is used to defines list items. |
Here the Example of simple Ordered list and Unordered list.
Example of (Ordered and Unordered List) List on HTML.
<!DOCTYPE html> <html> Â <head> Â Â Â <title>HTML list</title> Â </head> Â <body> Â Â Â <p>Unordered List</p> Â Â Â <P>Programming Language</P> Â Â Â <ul> Â Â Â Â <li>HTML</li> Â Â Â Â <li>CSS</li> Â Â Â Â <li>Java Script</li> Â Â Â Â <li>c++ Language</li> Â Â Â </ul> Â Â Â <p>Ordered List</p> Â Â Â <p>Programming Language</p> Â Â Â Â <ol> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>java Script</li> Â Â Â Â Â <li>C++ Language</li> Â Â Â </ol> Â </body> </html> |
Output of above Example (Ordered and Unordered List)
Unordered ListProgramming Language
Ordered List Programming Language
|
HTML Nested List
Sometimes we need to write nest list. That time we use nest list to make represent data to understanding easily.
This is the Example of Nested List.
Example of Nested List in HTML.
<!DOCTYPE html> <html> Â <head> Â Â Â <title>HTML list</title> Â </head> Â <body> Â Â Â <ul> Â Â Â <li>Programming Language</li> Â Â Â <li> Â Â Â <ul> Â Â Â Â <li>HTML</li> Â Â Â Â <li>CSS</li> Â Â Â Â <li>Java Script</li> Â Â Â Â <li>c++ Language</li> Â Â Â </ul> Â </li> Â Â Â <li>Programming Language</li> Â Â Â <li> Â Â Â <ol> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>java Script</li> Â Â Â Â Â <li>C++ Language</li> Â Â Â </ol> Â Â Â </li> Â Â Â </ul> Â </body> </html> |
Output of above Example (Nested List)
|
Colouring and Changing HTML List Bullets.
You can also change the color of bullets as you like and change custom bullets. Just using the internal CSS Style.
Example of Changing & Colouring of HTML List Bullets
<!DOCTYPE html> <html> Â <head> Â Â Â <title>HTML list</title> Â Â Â <style type="text/css"> Â Â Â ul{list-style: none;} Â Â Â li::before {content: "*"; Â Â Â Â color: black;} Â Â Â </style> Â </head> Â <body> Â Â Â <p>Different Types of List Style.</p> Â Â Â <ul style="color: red;"> Â Â Â Â <li>HTML</li> Â Â Â Â <li>CSS</li> Â Â Â Â <li>Java Script</li> Â Â Â Â <li>c++ Language</li> Â Â Â Â </ul> Â </body> </html> |
Output of above Example.
Different Types of List Style.
|
Above example you can see we take custom bullets and both bullets & text color is also change.
HTML List Style.
We can also change style of list in HTML, to change the list style we simply need to used style property from CSS (list-style-type).
HTML Example of Stylish List.
<!DOCTYPE html> <html> Â <head> Â Â Â <title>HTML list</title> Â Â Â <style type="text/css"> Â Â Â #circle {list-style-type: circle;} Â Â Â #upper-alpha {list-style-type:upper-alpha;} Â Â Â #square{list-style-type:square;} Â Â Â #upper-roman {list-style-type: upper-roman;} Â Â Â #none {list-style-type: number;} Â Â Â </style> Â </head> Â <body> Â Â Â <p>Different Types of List Style.</p> Â Â Â <ul id="circle"> Â Â Â Â <li>HTML</li> Â Â Â Â <li>CSS</li> Â Â Â Â <li>Java Script</li> Â Â Â Â <li>c++ Language</li> Â Â Â </ul> Â Â Â <ol id="upper-alpha"> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>java Script</li> Â Â Â Â Â <li>C++ Language</li> Â Â Â </ol> Â Â Â <ul id="square"> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>Java Script</li> Â Â Â Â Â <li>c++ Language</li> Â Â Â </ul> Â Â Â <ul id="none"> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>Java Script</li> Â Â Â Â Â <li>c++ Language</li> Â Â Â </ul> Â Â Â <ol id="upper-roman"> Â Â Â Â Â <li>HTML</li> Â Â Â Â Â <li>CSS</li> Â Â Â Â Â <li>java Script</li> Â Â Â Â Â <li>C++ Language</li> Â Â Â </ol> Â </body> </html> |
Output of above Example (Style List)
Different Types of List Style.
|
Above output of example, you can see the different types of list style like (Circle, Square, Roman, Number) It is done by style property (list-style-type).
In this tutorial we learned HTML List, different types of list style, custom list bullets and changed color of bullets. We hope you understand this tutorial, If you have any question comments below, Comment section.
Also Learn This-
- Html unordered list.
- Html bullet list.
- Html list-style.
- Types of lists in html.
- Html list without bullets.
- Nested list in html.
- Ordered and unordered list in html example.
- How to create an unordered list in html.
Â
3 Comments
zoritoler imol · July 2, 2022 at 12:19 am
Hey just wanted to give you a brief heads up and let you know a few of the images aren’t loading properly. I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same results.
suba.me · April 25, 2023 at 11:21 am
I’m not sure where you are getting your information, but good topic. I needs to spend some time learning more or understanding more. Thanks for great information I was looking for this information for my mission.
d-change.net · November 24, 2023 at 12:34 am
Good post. I will be experiencing a few of these issues as well..