有没有办法更改Bootstrap React卡组件的边框大小?

发布于 2025-02-10 05:33:49 字数 540 浏览 1 评论 0原文

通过Bootstrap React的读取文档> documentation ,我发现API包括边框颜色。 ..这几乎是边境的。有谁知道您是否也可以自定义边界的大小(宽度)?我还尝试编写一些自定义CSS来覆盖边框,将bootstrap-card className属性添加到< card>组件中,但是我尝试的内容不起作用:

//index.scss

.Bootstrap-Card {
    border-width: 10px;
    border-color: red;
}

//index.js

<Card className="Bootstrap-Card" style={{ width: '50rem' }}> ...

任何见解都将不胜感激,谢谢!

Reading through bootstrap react's documentation, I found that the API includes border color... and that was pretty much it for border. Does anyone know if you can customize the size (width) of the border as well? I also tried to write some custom css to overwrite the border, adding the Bootstrap-Card className attribute to the <Card> component, but what I tried did not work:

//index.scss

.Bootstrap-Card {
    border-width: 10px;
    border-color: red;
}

//index.js

<Card className="Bootstrap-Card" style={{ width: '50rem' }}> ...

Any insight would be greatly appreciated, thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剧终人散尽 2025-02-17 05:33:49
  1. 类似的导入CS:

    从“ ./app.module.css”;

    的导入样式

使用以下语法使用您的课程:

<Card style={{ width: "18rem" }} className={styles.cardCustomized}>
  1. 您也可以这样导入:

    导入“ ./app2.css”;

然后在className中直接使用字符串:

<Card style={{ width: "18rem" }} className="card-customized">

https://codesandbox.io/s/jolly-danny/jolly-danny -56cow6

  1. Import css like this:

    import styles from "./App.module.css";

Use your class with following syntax:

<Card style={{ width: "18rem" }} className={styles.cardCustomized}>
  1. You can also import like this:

    import "./App2.css";

and then use a string directly in className:

<Card style={{ width: "18rem" }} className="card-customized">

https://codesandbox.io/s/jolly-danny-56cow6

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文