简体   繁体   English

reactjs create-react-app bootstrap4卡无法正确渲染

[英]reactjs create-react-app bootstrap4 card not rendering correctly

I'm trying to use bootstrap4 with create-react-app. 我正在尝试将bootstrap4与create-react-app一起使用。 I realized bootstrap.min.css was missing so I put the following line in index.html in the public folder 我意识到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"> 

I tried using a card and the colors were missing. 我尝试使用卡,但颜色丢失。

        <div className="card card-inverse card-primary mb-3 text-center">
            <div className="card-block">
                <blockquote className="card-blockquote">
                    React.js
                </blockquote>
            </div>
        </div>

If I then typed a letter in the like 如果我再输入一个类似的字母

<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">

The the card color would show. 卡的颜色会显示出来。 If I then remove the letter and hit save the color disappeared. 如果我再去掉字母并点击保存,颜色就会消失。 What is going on here? 这里发生了什么?

Actually i don't know what should i see on page, but i can help you with live editor which uses create-react-app. 其实我不知道我应该在页面上看到什么,但是我可以通过使用create-react-app的实时编辑器为您提供帮助。 I did same thing for you and get some nice view on screen sandbox link 我为您做了同样的事情,并在屏幕沙箱链接上获得了一些不错的视图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM