Reputation: 6055
I have a CSS rule like this:
.blah-blah div
That rule hits many div
s on the page. When I uncheck that rule for any element in Chrome DevTools I think it "disables" the rule for all elements that it applies to. Is there any way to only uncheck that rule for the current element in question?
Upvotes: 0
Views: 658
Reputation: 25907
DevTools technical writer here. You're right. When you uncheck a general rule like this:
p {
margin-bottom: 1em;
}
It'll disable the rule for all p
nodes.
One workaround is to select the element in the DOM Tree and then declare a new rule in the element.style
block that cancels out whatever styling you're trying to suppress.
The element.style
block is equivalent to adding inline styles to the element's HTML via the style
attribute. The code in the screenshot above maps to this:
<p style="margin-top: 48px; background-color: beige;">...</p>
Upvotes: 1