删除网页css样式_如何一次删除页面上的所有CSS

删除网页css样式

I wanted to see how a page looked like without CSS.

我想看看没有CSS的页面的外观。

One way I know is to open the DevTools, in the Sources panel you’ll see the list of CSS files. You can remove the content in the CSS file in there, and the page will change. For example here’s my site.

我知道的一种方法是打开DevTools,在“源”面板中,您将看到CSS文件列表。 您可以在其中删除CSS文件中的内容,然后页面会发生变化。 例如这是我的 现场。

It has 3 CSS files, and I can go and delete the whole content of one:

它有3个CSS文件,我可以删除其中一个的全部内容:

and this is what happens, the page changes because we removed the CSS:

就是这样,因为我们删除了CSS,页面发生了变化:

Note that this just changes the browser’s version of the CSS, does not interact in any way with your file, even if it’s local

请注意,这只是更改浏览器CSS版本,不会与文件进行任何交互,即使它是本地文件也是如此

But some sites today embed the CSS in a style tag (including mine), and some have loads of CSS files scattered around, and it’s not practical.

但是如今,有些站点将CSS嵌入到style标签中(包括我的站点),有些站点周围散布着许多CSS文件,这是不切实际的。

Open the console and run this command:

打开控制台并运行以下命令:

document.querySelectorAll('style,link[rel="stylesheet"]').forEach(item => item.remove())

This removes both inline and linked CSS.

这将删除内联和链接CSS。

翻译自: https://flaviocopes.com/how-to-remove-all-css/

删除网页css样式

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值