Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should the list-style CSS property go?

Tags:

html

css

Should the list styling properties go on the ul element or the li elements?

I have never seen lists with different little icons to the left of them (within the same ul), but I have seen the property used on both elements before in my travels.

Which one is correct?

like image 759
alex Avatar asked Nov 05 '22 20:11

alex


1 Answers

It should go on the ul/ol, cf. http://www.w3.org/TR/CSS2/generate.html#list-style

Edit: Near the bottom ( http://www.w3.org/TR/CSS2/generate.html#propdef-list-style ) you will find a discussion of the issue. It boils down to:

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.

like image 169
jensgram Avatar answered Nov 15 '22 10:11

jensgram