[英]My GitHub page (css, js, style) doesn't work correctly
我对 GitHub 完全陌生,在尝试创建我的第一个项目时遇到了一些问题。
我正在使用 GitHub (username.github.io) 来预览(实时)。 但是在本地我的工作很好,但在 Github 页面中却没有。
在 Github 页面中,它不适用于任何 CSS、js 或我的样式。 我所有的 CSS、js 和样式都在 index.html 页面中。 如果我转到页面源,它会显示所有代码但不起作用! 我为显示实际(如本地主机)做了什么? 链接如下。 请看看并告诉我我在做什么?
浏览器控制台显示您的外部资源被阻止:
(index):8 Mixed Content: The page at 'https://mostafizur67.github.io/' was loaded over HTTPS, but requested an insecure stylesheet 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'. This request has been blocked; the content must be served over HTTPS.
(index):1 Mixed Content: The page at 'https://mostafizur67.github.io/' was loaded over HTTPS, but requested an insecure script 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'. This request has been blocked; the content must be served over HTTPS.
(index):13 Mixed Content: The page at 'https://mostafizur67.github.io/' was loaded over HTTPS, but requested an insecure stylesheet 'http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css'. This request has been blocked; the content must be served over HTTPS.
尝试使用https
而不是http
加载外部资源。
实际上不是一个 Git 问题,它实际上是一个 HTML/CSS 问题。
您在https
页面中有指向http
资源的链接,浏览器不喜欢这样。 更喜欢像//example.com/path/to/file
这样的链接到http://example.com/path/to/file
让你的浏览器选择正确的协议。
要调试此类问题,请使用浏览器提供的网站管理员工具。 例如,使用 Firefox,右键单击页面上的任意位置 -> Inspect 元素。 控制台显示错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.