I cant see开发者_Python百科m 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.
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
As you can see from the W3C documentation, it applies to elements with display: list-item
, that means to ul
and ol
elements.
精彩评论