使用网络应用程序时出现此错误。
这是我的主页
<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
最佳答案
看起来您的代码需要登录才能访问CSS样式表,并返回HTML登录页面而不是CSS。
为了进行验证,请尝试将样式表的URL粘贴到浏览器中,例如http://localhost:55381/Styles/Site.css-如果您获得的是登录页面而不是CSS,则需要进行修复。
关于stylesheet - 未加载css,因为其MIME类型 "text/html"不是 "text/css",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6915338/