CSS 权重计算
计算选择器 specificity 权重
🔒 100% client-side — your data never leaves this pageCSS Selector Input
Specificity
Specificity result will appear here
🔒 100% client-side
About this tool
用于计算 CSS 选择器的 specificity 权重,帮助你快速定位样式覆盖冲突和层叠顺序问题。适用于前端调试、样式重构和组件库治理,减少“为什么样式不生效”的排查时间。
Frequently Asked Questions
What format is used for specificity?
The tool outputs specificity as a,b,c where a is IDs, b is classes/attributes/pseudo-classes, and c is element selectors.
Can I check multiple selectors at once?
Yes. Paste one selector per line and each gets an individual score.
Does higher specificity always win?
Higher specificity generally wins, but !important and source order can also affect final style resolution.