The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Id is not dinamic?
I’ve heard that using id is bad idea, instead of this using class (and :nth-child) is much better for a dinamic site.
What do you think?
Can I use class instead of id in every case?
It depends on what you mean by “dynamic”.
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.