【问题标题】:why bootstrap_reboot not working in ReactJS为什么 bootstrap_reboot 在 ReactJS 中不起作用
【发布时间】:2020-05-25 11:34:33
【问题描述】:

已经好几天了,尝试了我在网上看到的所有建议,但引导重启在 reactjs 中不起作用。

我也试着把它放在我的 public/index.hmtl 中

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" 
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" 
crossorigin="anonymous">

另外,尝试将其导入为

import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap-reboot.min.css';

请帮忙。谢谢

【问题讨论】:

  • 您尝试更改订单了吗?
  • 不。但不工作。
  • bootstrap.min.css 中没有使用 bootstrap reboot 吗?
  • @SILENT 是的,但它不起作用。正如您在上面的屏幕截图中看到的那样。现在,我正在尝试重新订购,但还没有任何效果。
  • 你能显示 _reboot.scss 截图上方的所有项目吗?

标签: html reactjs bootstrap-4


【解决方案1】:

尝试在你的入口文件中添加这一行:

导入'bootstrap/dist/css/bootstrap.min.css'

并且也不要使用类,而是使用 React 推荐的类名。

【讨论】:

    【解决方案2】:

    转到getbootstrap.com

    并将 CDN 链接从公共文件夹复制到 index.html 。阅读文档并选择您的课程。 注意类属性在 React Component 中称为 className

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多