Skip to content Skip to sidebar Skip to footer

How To Remove Dot '.' From Css List-style:decimal

Is there any way to remove the DOT after the decimal numbers in List style? My CSS .snum li {list-style:decimal outside none;} The result i was getting like this (not including PH

Solution 1:

You can do this by implementing a custom counter as a pseudo-element before each <li> on your ordered list:

HTML:

<ol>
    <li>STUFF</li>
    <li>Stuff</li>
    <li>Stuff</li>
</ol>

CSS:

ol
{
    list-style: none;
    margin-left: 0;
}

li
{
    counter-increment: custom;
}

olli:before
{
    content: counter(custom) " ";   
}

olli:first-child {
    counter-reset: custom;
}

JSFiddle

Post a Comment for "How To Remove Dot '.' From Css List-style:decimal"