w3resource

CSS Properties: How to set the different type list style

Go to Exercise page

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

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes Yes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.