【问题标题】:Bootstrap card in react反应中的引导卡
【发布时间】:2020-05-13 19:14:20
【问题描述】:

我正在遭受在反应中实施引导程序的痛苦。我一开始就设置了 bootstrap4,但我的布局很糟糕,然后使用了 react-bootstrap,我遇到了同样的问题。图片本身出现卡体、标题和按钮enter image description here

import React from 'react';
import { Card, Button } from 'react-bootstrap';



const WorkCard = () => {
    return (
        <div>
            <Card style={{ width: '18rem' }} >
                <Card.Img variant="top" src="holder.js/100px180" />
                <Card.Body>
                    <Card.Title>Card Title</Card.Title>
                    <Card.Text>
                        Some quick example text to build on the card title and make up the bulk of
                        the card's content.
                    </Card.Text>
                    <Button variant="primary">Go somewhere</Button>
                </Card.Body>
            </Card >
        </div>
    )
}

export default WorkCard;

【问题讨论】:

  • 你在导入引导 css 吗?
  • 导入'bootstrap/dist/css/bootstrap.min.css';我在 index.js 中导入它
  • 你读过这个https://react-bootstrap.github.io/getting-started/introduction
  • 确定我做到了并应用了所有内容

标签: reactjs bootstrap-4 react-bootstrap


【解决方案1】:

使用 sass 会覆盖引导程序,所以我修复了它。

【讨论】:

  • 很高兴知道你自己修好了。
猜你喜欢
  • 2021-06-20
  • 1970-01-01
  • 1970-01-01
  • 2021-03-31
  • 2021-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-27
相关资源
最近更新 更多