DEV Community

Discussion on: 5 Quick facts on Universal Selector

Collapse
 
shahab570 profile image
Md Shahab Uddin

Please read this article. I hope you will get your answer dev.to/clairecodes/my-misconceptio...

Collapse
 
afif profile image
Temani Afif

I am not looking for an answer. I wanted you to elaborate your point (2) because it's not clear what you meant

Thread Thread
 
shahab570 profile image
Md Shahab Uddin • Edited

It's not compulsory to put id/class at the end of the selector. It is better to style elements in this way as much as possible because browser checks the rightmost selector first. So being specific is crucial.

The browser checks the rightmost selector first before moving left.
Therefore, when writing selectors, it's best to put something performant like a class or ID at the end.