css 未加载,因为其 MIME 类型“text/html"不是“text/css" [英] css was not loaded because its MIME type, "text/html", is not "text/css"

查看:81
本文介绍了css 未加载,因为其 MIME 类型“text/html"不是“text/css"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用网络应用程序时遇到此错误.这是我的母版页

I got this error while working with web app. This is my master page

<head runat="server">
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>

这是错误:

Error: The stylesheet http://localhost:55381/Login.aspx?ReturnUrl=%2fStyles%2fSite.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://localhost:55381/Login.aspx
Line: 0

推荐答案

试试这个:

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

其中 Styles 是包含样式表的文件夹.我是这样解决的

Where Styles is the folder that contains style sheet. I solved it this way

这篇关于css 未加载,因为其 MIME 类型“text/html"不是“text/css"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆