Search code examples
google-chromegoogle-chrome-devtools

Chrome - disable all styles from specific .css file


When inspecting a web site, is it possible to disable a particular .css file? I can do it in FireFox but can't find the option in Chrome.


Solution

  • If you want to remove the style for the remainder of the page session, open the DOM Inspector, locate the <link> or <style> element which links the style sheet, and remove the element. This causes all associated styles to be removed.

    If you only want to disable the style sheet temporarily, add a new attribute disabled to the <link>/<style> element. Remove this attribute to enable the style sheet again.

    If the site contains lots of distracting DOM elements, you can also visit the console, and something like document.styleSheets[0].disabled = true; (where 0 is the index of the style element).