【发布时间】:2018-10-24 06:22:57
【问题描述】:
我正在制作一个 reactjs 网络应用程序,并想使用 react-bootstrap。 我的 index.html 看起来像:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Winova</title>
<link rel="stylesheet" href="assets/styles/bootstrap.min.css">
<body>
<section id="index"></section>
</body>
</html>
我得到的错误:
拒绝应用来自'http://localhost:8098/assets/styles/bootstrap.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.的样式
如果我像这样添加它,它会起作用:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
问题是我不想依赖外部链接,我想在我的服务器上拥有自己的副本。
【问题讨论】:
-
此链接可能有您正在寻找的答案:stackoverflow.com/questions/48248832/…
标签: html css reactjs react-bootstrap