使用Material UI的卡片时。我遇到了我通常没有的问题。 在底部和顶部已被切除的盒状阴影。
我该如何解决?
我的代码在这里:
import React, { Component } from 'react'
import './demo.css'
import { Card } from '@material-ui/core';
export default class MasonryLayout extends Component {
render() {
return (
<div className="masonry">
<Card className="item" style={{height:"120px"}} elevation={4}/>
<Card className="item" style={{height:"190px"}} elevation={4}/>
<Card className="item" style={{height:"220px"}} elevation={4}/>
<Card className="item" style={{height:"130px"}} elevation={4}/>
<Card className="item" style={{height:"140px"}} elevation={4}/>
</div>
)
}
}
.masonry {
column-count: 2;
column-gap: 56px;
margin: 50px;
}
.item {
margin-bottom: 40px;
break-inside: avoid;
}
屏幕截图自爆: