ber er
ber er

Reputation: 5

How to find what's ovverrding CSS element?

I am trying to find what is overriding my CSS element using chromes element selector but am unable too.

This answer seems outdated I can't find how to access "computed styles": Chrome Developer Tools: How to find out what is overriding a CSS rule?

I don't know why this color is overridden with gray: chrome

How can I find whats doing it with google chrome?

Upvotes: 0

Views: 45

Answers (1)

user1641831
user1641831

Reputation:

If you look at the image, it will tell you that the property is changed in the element.style.

In other words, the change is not applied using a selector such as class or id, but rather to the element itself.

This can be done in two ways, as far as I am aware.

1) In HTML, writing the properties directly within the element:

<div style="color:gray;"></div>

2) In Jquery, referencing the specific object (for example, using the id property) and then using the css property:

$('#divname').css({
    color:gray;
});

With regard to finding what is causing the issue:

1) Finding out if the change has been made in HTML should be fairly straightforward, as you would just need to have a look at the HTML file.

2) If the change has been made through Jquery, things get a little more complicated: a ghetto method would be to search your script files for the "gray" string. Don't forget that scripts can also be embedded into HTML, however, looking for the property the HTML file would be a good way to proceed :)

Upvotes: 1

Related Questions