访问github无css样式的解决方案

1、浏览器右键查看加载失败的css文件来源
加载失败此处文件名会为红色
这里写图片描述
复制域名assets-cdn.github.com
2、查询css文件所在ip
打开https://www.ipaddress.com右上角输入框粘贴之前的css所在域名,点击搜索,记下搜索结果的ip
这里写图片描述
3、修改host文件
mac下:
打开finder(访达),点击右上角 前往-前往文件夹
输入/private,右键显示简介,将everyone权限改为读和写(需输入账号和密码),并将修改应用到包含项目
这里写图片描述
4.打开etc/hosts文件根据之前的ip查询结果,修改host为如下:

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 
151.101.112.133 assets-cdn.github.com

这里写图片描述
大功告成~

猜你喜欢

转载自blog.csdn.net/qq_31393401/article/details/80729765