2016-09-25 34 views
0

我完全不熟悉github頁面,並且在創建第一個項目時遇到了一些問題。爲此,我使用github頁面(username.github.io)進行實時預覽。但在本地它運作良好,但不在github頁面。在github頁面中,它不適用於任何css,js或我的風格。我所有的CSS,JS和風格都在index.html頁面中。如果我去頁面源顯示所有的代碼,但不工作! 我做什麼顯示實際(如本地主機)?鏈接在下面給出。請看看並告訴我我在做什麼?我的GitHub頁面(css,js,style)無法正常工作

https://mostafizur67.github.io

+0

可能重複[阻止加載混合活動內容](http://stackoverflow.com/questions/20605423/blocked-loading-mixed-active-content) – poke

回答

1

瀏覽器控制檯顯示您的外部資源被封鎖:

(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加載外部資源。

+0

@ msmolens我可以更改HTTP爲https? – user3291513

+0

是的,這應該工作。 – msmolens

+0

@ msmolens感謝它的工作:) – user3291513

0

其實不是Git的問題,它確實是一個HTML/CSS的問題。

您有鏈接到https頁面的http資源,瀏覽器不喜歡這樣。優先選擇//example.com/path/to/filehttp://example.com/path/to/file之間的鏈接,讓瀏覽器選擇正確的協議。

要調試這類問題,請使用瀏覽器提供的網站管理員工具。例如,在Firefox中,右鍵單擊頁面上的任意位置 - >檢查元素。控制檯顯示錯誤。