CSS Properties: How to set the different type list style
Solution:
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title>How to set the different type list style</title>
<style type="text/css">
ol.w3r{
list-style-type: decimal-leading-zero;
}
ol.w3r1{
list-style-type: upper-alpha;
}
ol.w3r2 {
list-style-type: lower-roman;
}
ul.w3r3 {
list-style-type: square;
}
ul.w3r4 {
list-style-type: circle;
}
ul.w3r5 {
list-style-type: disc;
}
</style>
</head>
<body>
<p>Ordered lists</p>
<ol class="w3r">
<li>HTML</li>
<li>CSS</li>
<li>Java</li>
</ol>
<ol class="w3r1">
<li>HTML5</li>
<li>CSS3</li>
<li>JavaScript</li>
</ol>
<ol class="w3r2">
<li>SQL</li>
<li>MySQL</li>
<li>PostgreSQL</li>
</ol>
<p>Unordered lists</p>
<ul class="w3r3">
<li>XML</li>
<li>JSON</li>
<li>Ajax</li>
</ul>
<ul class="w3r4">
<li>MongoDB</li>
<li>Oracle</li>
<li>Redis</li>
</ul>
<ul class="w3r5">
<li>NoSQL</li>
<li>SQLite</li>
<li>Python</li>
</ul>
</body>
</html>
Live Demo:
See the Pen list-style-type-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join