0
SAmain.css未加載,因爲其MIME類型「text/html」不是「text/css」?
我知道這個問題已經有多個答案,但沒有與我一起工作,因爲我有點奇怪。
基本上我有幾頁說:
index.html
contacts.html
find.html
header.html // main.css files contains styling for this header file which is dynamically loaded into different pages.
的問題是,當我的頭文件加載到index.html
或contacts.html
它加載罰款,但後來當我在find.html
加載它,它會彈出瀏覽器控制檯錯誤他說:
Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead[Learn More] JquerySock.js:1
The stylesheet http://localhost:20012/Duck/main.css was not loaded because its MIME type, 「text/html」, is not 「text/css」. search
The stylesheet http://localhost:20012/Duck/CSS/search.css was not loaded because its MIME type, 「text/html」, is not 「text/css」. search
The stylesheet http://localhost:20012/Duck/mainelements/aside.css was not loaded because its MIME type, 「text/html」, is not 「text/css」.
還請求頭content-type
恰巧是爲text/css
但反應出來作爲text/html
真的不知道爲什麼。 僅供參考:我正在使用Debian(Jessie)。 Firefox ESR v52.4.0
我知道你複製粘貼這個答案。無論如何,我可以通過「http:// localhost:20012/Duck/main.css」作爲url鏈接訪問我的樣式表。順便說一句你把代碼放在哪裏? – Whatever
是的,我複製了..對不起,我忘了把鏈接。 –
https://stackoverflow.com/questions/5413107/headercontent-type-text-css-is-working-in-firefox-and-chrome-but-in-inter @Whatever ..看看這兩個.. http://galleryproject.org/node/27061 –