【发布时间】:2022-08-15 16:58:07
【问题描述】:
我对使用 MUI Grid 比较陌生,并不想做任何太复杂的事情,但我无法在其他帖子或 Flexbox/MUI 文档中找到解决方案。本质上,我只想将我的“取消”和“保存”按钮一直对齐到屏幕右侧。文档似乎使这看起来非常简单,但我的页面布局没有受到影响。我一直在尝试 alignItems、alignContent、justifyContent 等,只是为了让它发挥作用——但无济于事。
<Grid container xs={12} justify-content=\'flex-end\'>
<Grid item xs={6}/>
<Grid item xs={3}>
<button
onClick={() => doSomething()}
Click here to cancel
</button>
</Grid>
<Grid item xs={3}>
<button
onClick={() => doSomething()}
Click here to Save
</button>
</Grid>
</Grid>
标签: css flexbox material-ui