Github网站css加载不出来的处理方法(转,亲测有效)
2024-09-04 15:40:40
转载链接:https://blog.csdn.net/qq_36589706/article/details/80573008
因为工作需求,自己会经常使用到github,但是突然有一天打开github时,发现css样式全没了,如下图,网速正常的时候也是这样,怎么办呢,趁着今天周六,闲下来了,就找找博客,终于解决了,记录一下~
场景重现:
网站响应缓慢,排版错误,图片加载不出。
以谷歌浏览器为例,F12打开开发者选项,可以看到如下报错信息:
可以看出,是Github需要在线加载的资源(css,js)文件未能成功加载
解决办法:
为了提高速度,可以使用HOSTS加速对Github网站加载的资源网站域名解析。
具体做法:
修改 C:\Windows\System32\drivers\etc 中的hosts文件(PS:若没有修改权限,可以鼠标右键,属性,安全,修改权限。或者将hosts文件复制到桌面,修改之后,复制到原文件夹),将下面一段话添加到hosts文件中:
# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End
保存hosts文件,重新打开Github网站,此时网站的访问应该可以恢复正常。
如果没有立即恢复正常,需要刷新DNS缓存,告诉电脑我的hosts文件已经修改。Windows下刷新DNS缓存的方法:进入命令行,输入命令:ipconfig /flushdns
最新文章
- 利用百度云免费备份SQL数据库
- 《Pro Git》阅读随想
- Struts2的模板和主题theme及自定义theme的使用
- js调用父窗口中的方法
- WPF自定义窗口基类
- C#中调用C++的dll的参数为指针类型的导出函数(包括二级指针的情况)
- Android常用动画Animation的使用
- aop编程 环绕round
- tomcat Server.xml Context配置
- C#仪器数据文件解析-RTF文件
- 笔记:Hibernate 持久化类标注说明
- SCOI2019酱油记
- php curl Problem with the SSL CA cert (path? access rights?)
- orcal - 增删改
- Oracle SQL调优记录
- 2014-2015 ACM-ICPC, Asia Xian Regional Contest(部分题解)
- SQL Server 本地数据库登录不上 解决方法
- echarts2 饼图处理标签文字过长使之达到指定字数换行的目的
- [转]What are mode and status columns under gp_segment_configuration table
- accumarray
热门文章
- 跨平台的WebRTC客户端框架:OpenWebRTC
- 洛谷【P3908】异或之和
- java中toString() 、(String)、String.valueOf的区别
- 在Altium Designer 2009下如何添加Logo图
- Dialog 自定义使用2(进度条)
- 02_android下单元测试
- [51nod1267]4个数和为0(预处理+双指针)
- p2921 Trick or Treat on the Farm
- 基于http的多进程并发文件服务器
- Spring入门第二十八课