ID can be used where you need to specifically identify a single element on a page….usually as a javascript hook.
Otherwise, use a class.
As for :nth-child or whatever, it will entirely depend on what this issue is.
There is no need (generally) to add an ID or class to every element. Just the ones that need styling in common and even then it might be possible to use combinator selectors instead.
Basically, it depends.
Author
Posts
Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘CSS’ is closed to new topics and replies.