Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See exact CSS specificity in Chrome Dev Tools?

I know that in Chrome Dev Tools, for a selected HTML element, applicable CSS selectors are listen in order of specificity in the Styles tab.

But is it possible to see the exact exact CSS specificity value of each rule on the selected element?

EDIT: One answer says that I can see the CSS specificity value in the computed tab, but I don't see it there. See screenshot below. Maybe I need to clarify that when I am asking to see the CSS specificity value I am looking for a number like 0010 for a class selector or 0001 for an element selector.

enter image description here

like image 514
user1283776 Avatar asked Jun 08 '18 11:06

user1283776


People also ask

How do you find the specificity in CSS?

Memorize how to calculate specificity! Start at 0, add 100 for each ID value, add 10 for each class value (or pseudo-class or attribute selector), add 1 for each element selector or pseudo-element. Note: Inline style gets a specificity value of 1000, and is always given the highest priority!

How do I view CSS in Google Chrome?

On Chrome's Developer Tools tab (CTRL + SHIFT + I), go to Resources (you may have to enable Resource tracking on that page), and click on the sub-tab Stylesheets. That will show all css files loaded by that page.

How do you check every inherited style for an element in your browser's Developer Tools?

You can find it by just clicking Show Inherited check box on Chrome's computed style panel likes below.


1 Answers

The chrome extension "CSS Dig" offers a solution to the finding the values of specificity in chrome in 0,0,0 format

The extension works and does the job but has a few bugs

Link : https://chrome.google.com/webstore/detail/css-dig/lpnhmlhomomelfkcjnkcacofhmggjmco?utm_source=chrome-ntp-icon

like image 114
srinivas chilukuri Avatar answered Sep 20 '22 15:09

srinivas chilukuri