如何从损坏的CSS文件中恢复CSS规则

编程入门 行业动态 更新时间:2024-10-15 00:27:58
本文介绍了如何从损坏的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).

最后,签出此线程:

groups.google/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规则

本文发布于:2023-06-06 01:36:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/531147.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:规则   文件   CSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!