【发布时间】:2020-09-13 13:36:03
【问题描述】:
我通过映射产品来循环访问它们,而 justify-content-around 不适用于它们,我在我的 react 项目中使用 bootstrap 4。
这是我的代码:
{props.products.map((item) => {
if (item.inCart) {
return (
<div className="d-flex justify-content-around w-100" key={item.id}>
<button>remove</button>
<div>
<h5>{item.name}</h5>
</div>
<div>
<h5>{item.price.toLocaleString('ar-EG')}</h5>
</div>
<div>
<h5>{item.number.toLocaleString('ar-EG')}</h5>
</div>
<div>
<h5>{(item.number * item.price).toLocaleString('ar-EG')}</h5>
</div>
<hr />
</div>
);
}
显示 flex 类适用,但不是另一个,它们之间没有边距。
如何让它们显示 justify-content-around ??
【问题讨论】:
标签: javascript css reactjs twitter-bootstrap