【发布时间】: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