【发布时间】:2020-12-03 11:30:49
【问题描述】:
我无法用 css 解决错误:
来自“http://localhost:63342/static/style.css”的资源是 由于 MIME 类型(“text/html”)不匹配而被阻止 (X-Content-Type-Options: nosniff)。
文件夹结构为:
root
|-> content
-| index.html
|-> static
-| style.css
-| script.js
在 index.html 中我导入样式表:
<link href="../static/style.css" rel='stylesheet' type='text/css'>
但是会导致控制台出现上述错误。该错误声称我的类型是'text/html'?
我的 css 文件:
html {
height: 100%;
}
body {
min-height: 100%;
}
.section {
display: none;
margin-top:40px;
border-top:1px solid #ccc;
}
可能有什么问题?
我以类似的方式导入 js 脚本,它工作正常:
<script type="text/javascript" src="../static/jct.js"></script>
【问题讨论】: