DEV Community

Isienyi Paschal Ejike
Isienyi Paschal Ejike

Posted on

CSS POINTS

I just got to know about the CSS points which could help you understand the specificity of one's styling.

Styling a project sometimes becomes difficult not understanding why a particular element is not showing the style added to it, this might be due to the specificity rule.

These are the rules for calculating CSS points for specificity,

Element - 1 point,
Classes - 10 points,
Id - 100 points.

When you have a compound selector, just add up based on the selectors used to get the degree of specificity.

So in your next project, if you are experiencing difficulty styling an an element and it's not showing the style, please check up the specificity.

Happy coding...

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay