can you give more detail about the (2) ? I don't understand why you think we should put ID or class at the end. It depends on the nature of the selector unless you are talking about some particular cases
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
can you give more detail about the (2) ? I don't understand why you think we should put ID or class at the end. It depends on the nature of the selector unless you are talking about some particular cases
Please read this article. I hope you will get your answer dev.to/clairecodes/my-misconceptio...
I am not looking for an answer. I wanted you to elaborate your point (2) because it's not clear what you meant
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.