小编应俊康*_*应俊康的帖子

材质UI卡盒-阴影被剪掉

使用 Material UI 的 Card 时。我遇到了一个我通常不会遇到的问题。盒子阴影在底部和顶部手侧被切除。

我怎样才能解决这个问题?

我的代码在这里

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>
    )
  }
}
Run Code Online (Sandbox Code Playgroud)
.masonry {
    column-count: 2;
    column-gap: 56px;
    margin: 50px;
}

.item {
    margin-bottom: 40px;
    break-inside: avoid;
}
Run Code Online (Sandbox Code Playgroud)

截图炸了

截屏

javascript css material-ui

5
推荐指数
1
解决办法
4855
查看次数

标签 统计

css ×1

javascript ×1

material-ui ×1