如何从损坏的CSS文件中恢复CSS规则 [英] How To Recover CSS Rules From A Corrupted CSS File

查看:187
本文介绍了如何从损坏的CSS文件中恢复CSS规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.css文件运行正常,但今天我注意到该网站不是基于CSS规则运行的,因此我尝试检查浏览器上的规则,令人惊讶的是,我发现CSS文件为空! 我试图在Notepad ++中打开style.css文件,这就是它的样子

My .css file was working fine but today I noticed the website is not acting based on CSS rules so I tried to inspect the rues on browser and surprisingly I noticed the CSS file is empty! I tried to open the style.css file in Notepad++ and this is how it looks like

我也试图在Bracket编辑器中打开该文件,我收到了此消息

I also tried to open the file in Bracket editor which I got this message

能否让我知道是否有办法解决此问题并从这些NUL中检索CSS规则?

Can you please let me know if there is a way to fix this issue and retrieve the CSS rules from these NULs?

推荐答案

如果文件确实已损坏,并且您的网站托管计划中包含站点备份,则将网站还原到文件可以工作的位置. (根据您的托管计划,许多提供备份的Web主机将存储30天的价值.)

If your file is indeed corrupted, and you have site backups as part of your hosting plan, restore your website to a point where your file worked. (Many web hosts that offer backups will store 30 days' worth, depending on your hosting plan.)

如果您没有这样的托管计划,请转到Wayback Machine并搜索您的URL.选择您网站运行时的快照日期.在源代码中查找并找到指向Wayback的CSS文件缓存版本的链接.从那里复制CSS.

If you don't have such a hosting plan, go to Wayback Machine and search for your URL. Pick a snapshot date when your site was working. Look in your source code and find a link to Wayback's cached version of your CSS file. Copy your CSS from there.

或者,尝试在Google中搜索您的网站.除非您的网站上没有noarchive标签,否则搜索结果中应该有一个链接,可以访问网站的缓存版本.如果Google在文件损坏之前上次爬网您的网站,则您应该能够通过源代码(或开发工具中的链接)访问缓存的CSS文件.

Alternatively, try searching for your website in Google. Unless you have noarchive tags on your site, there should be a link right in your search results to access a cached version of your site. If Google last crawled your site before your file got corrupted, you should be able to access your cached CSS file through the source code (or a link in Dev Tools).

最后,签出此线程:

https://groups.google.com/forum/# !topic/brackets-dev/4hEn8qs9MKs

您也许可以在第三个代码编辑器中打开文件并将其另存为UTF-8.

You may be able to open the file in a third code editor and save it as UTF-8.

这篇关于如何从损坏的CSS文件中恢复CSS规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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