2017-10-18 15 views
0

SAMIMEタイプ "text/html"が "text/css"でないため、main.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-typetext/cssのように起こるが、応答は本当に理由を知らないtext/htmlとして起動します。 参考:私はDebian(Jessie)を使用しています。 Firefox ESR v52.4.0

答えて

0

CSSスタイルシートにアクセスし、CSSの代わりにHTMLログインページを返すためにコードにログインする必要があるようです。

ここで、「スタイル」はcssを含むフォルダです。

<location path="~/Styles"> 
<system.web> 
    <authorization> 
    <allow users="*"/> 
    </authorization> 
</system.web> 
+0

私はこのコピーを貼り付けています。とにかく私は 'http:// localhost:20012/Duck/main.css'というスタイルシートにURLリンクとしてアクセスできます。どこにそのコードを置くのBTWどこですか? – Whatever

+0

私はコピーしました。申し訳ありません、私はリンクを張るのを忘れました。 –

+0

https://stackoverflow.com/questions/5413107/headercontent-type-text-css-is-working-in-firefox-and-chrome-but-in-inter @Whatever ..これを見てください.. http://galleryproject.org/node/27061 –

関連する問題