zoukankan      html  css  js  c++  java
  • Github网站css加载不出来的处理方法(转,亲测有效)

    转载链接:https://blog.csdn.net/qq_36589706/article/details/80573008
    因为工作需求,自己会经常使用到github,但是突然有一天打开github时,发现css样式全没了,如下图,网速正常的时候也是这样,怎么办呢,趁着今天周六,闲下来了,就找找博客,终于解决了,记录一下~

    场景重现:

    网站响应缓慢,排版错误,图片加载不出。

    以谷歌浏览器为例,F12打开开发者选项,可以看到如下报错信息: 

     可以看出,是Github需要在线加载的资源(css,js)文件未能成功加载

    解决办法: 
    为了提高速度,可以使用HOSTS加速对Github网站加载的资源网站域名解析。

    具体做法:

    修改 C:WindowsSystem32driversetc 中的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

  • 相关阅读:
    Android学习总结(十三) ———— ListView 简单用法
    Android学习总结(十二)———— BaseAdapter优化
    Android学习总结(九)———— 内容提供器(ContentProvider)
    Android学习总结(十)———— Intent的使用
    RHEL 6.5升级GCC 4.9.3
    nodejs npm install全局安装和本地安装的区别
    ACE_linux:Reactor与Proactor两种模式的区别
    ACE_linux:任务 & 命令(Task and Command)
    ACE_linux:UDP通信
    ACE_linux:TCP通信
  • 原文地址:https://www.cnblogs.com/DZzzz/p/9276766.html
Copyright © 2011-2022 走看看