Chrome - 禁用特定.css文件中的所有样式 [英] Chrome - disable all styles from specific .css file

查看:1301
本文介绍了Chrome - 禁用特定.css文件中的所有样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在检查网站时,是否可以禁用特定的.css文件?我可以在FireFox中做到这一点,但在Chrome中找不到选项。

打开DOM Inspector,找到< link> < style> 元素,其中链接样式表,并删除元素。这会导致所有关联的样式被移除。



如果您只想临时禁用样式表,请添加一个新属性 disabled < link> / < style> 元素。 如果网站包含大量令人分心的DOM元素,则还可以访问控制台,并且可以访问 document.styleSheets [0] .disabled = true; (其中 0 是样式元素的索引)。 $ b

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.

解决方案

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).

这篇关于Chrome - 禁用特定.css文件中的所有样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆