swdeveloper
swdeveloper

Reputation: 918

How to remove the particular CSS style (set through CSS file) from an HTML list

I have applied following styles on HTML list in my CSS file

list-style-image: none;
list-style-type: none;

But then, in a page I want to have items listed in an alphabetical order (means an OL list). But when I write the <ol type="a">...</ol> then items are not displayed in ordered-list manner, because I think the style set in CSS file through above mentioned properties affects it.

So can anyone tell what the problem really is and how to solve it. Is there any way to remove that CSS property (list-style-type: none;) so that the items are show in normal way.

Upvotes: 0

Views: 109

Answers (2)

RMSTOKES
RMSTOKES

Reputation: 81

list-style-image and list-style-type have nothing to do with ordering alphabetically. These set the style of the list e.g. bullet and the image to use for the bullet. In regards to overriding the css this will work:

Give your ol a class and set it to whatever you wish.

<ol class="different-ol-style">...</ol>

.different-ol-style{
list-style-type:lower-alpha;
}

Upvotes: 1

Petar Vasilev
Petar Vasilev

Reputation: 4745

You can apply the rule only to ul like this:

ul {
    list-style-image: none;
    list-style-type: none;
}

Upvotes: 1

Related Questions