【发布时间】:2021-09-21 23:50:22
【问题描述】:
我正在使用 Material UI,我有一个简单的 Grid 组件,其中嵌套了三个 Grid,如下所示:
父容器是一个带有这些属性的 Grid:
<Grid container component="form" noValidate autoComplete="on" gap={2}>
问题在于,通过将 gap={2} 添加到父级按钮会被按下,尽管它具有 box-sizing:border-box;
这是 Material UI 提供的默认 css:
似乎 box-sizing 忽略了差距。 我可以使用 flex-wrap: nowrap 强制执行此操作,但应该有一种方法可以让 box-sizing 不会忽略间隙,对吧?
【问题讨论】:
标签: reactjs material-ui