200

Well, this is pretty straightforward. If Chrome's Developer Tools is showing me that a style is overridden, how to see what CSS rule is overriding it?

I want to know if is there anything like "Show me what overrides this".

OBS: Please, don't point me to Firebug.

Donald Duck
  • 6,488
  • 18
  • 59
  • 79
Ramon K.
  • 3,230
  • 3
  • 16
  • 21

3 Answers3

288

Use the Computed Style panel of the element inspector. Expand the property of interest to see the list of applicable rules, and which one won.

Chrome screenshot

josh3736
  • 124,335
  • 26
  • 203
  • 248
  • For me the computed tab was open at default and therefore not listed as a tab, it should have had a header 'Computed', otherwise you could be looking for a long time. – MrFox Jul 20 '15 at 08:44
  • 1
    The technique has changed a little as Chrome has advanced. Instead of 'Expand the property of interest' click the spy-glass next to the property and it will show which style won back in the Styles tab. – intotecho Nov 20 '15 at 06:42
  • 3
    @intotecho: Chrome 47 has restored the expando in the Computed tab since the magnifying glass change sucked. [crbug.com/496263](https://crbug.com/496263) – josh3736 Nov 20 '15 at 19:40
  • what if ALL of them are cancelled? Probably due to a script? How do you find out who did it? – darkgaze Jun 23 '17 at 08:28
  • It's still there as the "Computed" tab on the Elements panel. – josh3736 Dec 18 '18 at 00:45
  • @josh3736,maybe my css has `!important` but can't find anything overriding in Computed or elsewhere – Daniel Manta Dec 19 '18 at 23:02
  • I would avoid trying to use !important to begin with. When you start tossing multiple css libraries into the mix, and then you add your own styling yielding unexpected results, you are in for an action-filled evening. – Donato Mar 02 '20 at 15:56
7

You can simply look at the ones with the same name which aren't striked out, remember the listing is by importance.

Or you can view the computed styles. They will be the actually applied styles.

2

crtrl + shift + c and inspect the element. Then find the style without a line through it, in the box in the down right corner.

the override is in most cases at the top (and without a line through it, as this style is the "winning" one).

Peter Rasmussen
  • 14,574
  • 7
  • 43
  • 60