Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apply list-style-type to ul or li

Tags:

html

css

I cant seem to find a conclusive answer on whether i should be applying the style list-style-type ( or any of it's relatives ) to ul/ol tags or to the li tag. This is probably because it doesn't make any difference but maybe someone could confirm that and offer a suggestion as to best practice.

like image 479
byronyasgur Avatar asked Sep 23 '11 17:09

byronyasgur


1 Answers

the best practice is to assign list styles to the list itself (ul, ol), and li's will have it because of the cascading

from w3 css2.1 recommendation:

Inheritance will transfer the 'list-style' values from OL and UL elements to LI elements. This is the recommended way to specify list style information.

however, ie6 and 7 won't recognize this inheritance correctly, so you'll have to apply the list styles to li elements if you plan to support them

like image 105
Einacio Avatar answered Oct 27 '22 01:10

Einacio