3 ms·
The main reason is that including IDs makes “selector points” much more complex. A selected with one ID will outweigh a selector with two classes for instance.
by TorbjornLunde 16y ago
The main reason is that including IDs makes “selector points” much more complex.
A selected with one ID will outweigh a selector with two classes for instance. This can quickly lead to complexity because you need to use a ID many places in order to override a selector that used ID.
A class only used once serves the same purpose as ID (CSS-wise), expect that you avoid a lot of problems.
I might use IDs for anchor purposes (site.com/foo#section), but I never reference it in my CSS.