簡體   English   中英

我的 GitHub 頁面(css、js、樣式)無法正常工作

[英]My GitHub page (css, js, style) doesn't work correctly

我對 GitHub 完全陌生,在嘗試創建我的第一個項目時遇到了一些問題。

我正在使用 GitHub (username.github.io) 來預覽(實時)。 但是在本地我的工作很好,但在 Github 頁面中卻沒有。

在 Github 頁面中,它不適用於任何 CSS、js 或我的樣式。 我所有的 CSS、js 和樣式都在 index.html 頁面中。 如果我轉到頁面源,它​​會顯示所有代碼但不起作用! 我為顯示實際(如本地主機)做了什么? 鏈接如下。 請看看並告訴我我在做什么?

https://mostafizur67.github.io

瀏覽器控制台顯示您的外部資源被阻止:

(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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM