React-bootstrap 轮播样式不适用
React-bootstrap carousel styles don't applying
我已经安装了 react-bootstrap:
npm install react-bootstrap bootstrap
命令,并成功导入:
import Carousel from 'react-bootstrap/Carousel'
<Carousel>
...
</Carousel>
但它的样式没有应用!
我需要做什么才能正确使用它?
React-Bootstrap 不会自动附带 bootstrap CSS - 它只会生成相应的 div
元素 类.
如果您使用的是 css 模块,请在 index.js
中导入 bootstrap css:
import "bootstrap/dist/css/bootstrap.min.css";
如果您使用的是普通 HTML,请以某种方式在 html 文件中包含 bootstrap.min.css
。
我已经安装了 react-bootstrap:
npm install react-bootstrap bootstrap
命令,并成功导入:
import Carousel from 'react-bootstrap/Carousel'
<Carousel>
...
</Carousel>
但它的样式没有应用! 我需要做什么才能正确使用它?
React-Bootstrap 不会自动附带 bootstrap CSS - 它只会生成相应的 div
元素 类.
如果您使用的是 css 模块,请在 index.js
中导入 bootstrap css:
import "bootstrap/dist/css/bootstrap.min.css";
如果您使用的是普通 HTML,请以某种方式在 html 文件中包含 bootstrap.min.css
。