Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS list-style-type not working

Tags:

I have set the list-style-type in CSS, but for some reason it's not showing it.

body {    margin: 0;  }  ol {    list-style-type: decimal;    padding-left: 0;  }
<ol>    <li>Item 1</li>    <li>Item 2</li>    <li>Item 3</li>  </ol>
like image 677
SeinopSys Avatar asked Sep 16 '12 14:09

SeinopSys


People also ask

What does list style type none do?

The VoiceOver screen reader has an issue where unordered lists with a list-style-type value of none applied to them will not be announced as a list. To address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly.

What is the difference between list style and list style type?

List-style is simply the shorthand version for styling your list. List style type specifically refers to the indicator to the left such as the ever popular none, or disc, decimal, etc.


2 Answers

Because of your padding reset, the numbers are actually off to the left of the page. Try adding:

list-style-position: inside; 
like image 106
Niet the Dark Absol Avatar answered Sep 20 '22 21:09

Niet the Dark Absol


display:list-item; list-style-position:outside; 

It may give problem if list display: attribute is set to some thing else than display:list-item;

like image 38
Musaddiq Khan Avatar answered Sep 16 '22 21:09

Musaddiq Khan