[英]Bootstrap styling disappears in production build of create-react-app
[英]reactjs create-react-app bootstrap4 card not rendering correctly
我正在尝试将bootstrap4与create-react-app一起使用。 我意识到bootstrap.min.css丢失了,所以我将以下行放在公用文件夹的index.html中
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
crossorigin="anonymous">
我尝试使用卡,但颜色丢失。
<div className="card card-inverse card-primary mb-3 text-center">
<div className="card-block">
<blockquote className="card-blockquote">
React.js
</blockquote>
</div>
</div>
如果我再输入一个类似的字母
<head>s
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
crossorigin="anonymous">
卡的颜色会显示出来。 如果我再去掉字母并点击保存,颜色就会消失。 这里发生了什么?
其实我不知道我应该在页面上看到什么,但是我可以通过使用create-react-app的实时编辑器为您提供帮助。 我为您做了同样的事情,并在屏幕沙箱链接上获得了一些不错的视图
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.