Styling lists - targeting ul or li?

Hi all!
Wonder if it is important, where you attach your styling to in a list - to the ul/ol or the li ?
codepen example .
Find it easier to target just the ul and it inherits its styling downwards.
Does it matter, or just my choice?
Thank you! :slight_smile:

As long as it does what you want it do then I would say it doesn’t matter. I think most people would add styles that apply to all items to the list element instead of the list item element. Just seems to make more sense.

1 Like

Thank you so much for your thoughts! Sometimes I see the styling being attached to all li, but who knows why. So I am glad it does not matter. Thank you! :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.