【发布时间】:2021-04-04 18:06:14
【问题描述】:
我在 ReactJs 中使用 MUI Grid 结构来显示 5 列,如下所示:
在较小的屏幕中,列移动到下一行。但在较小的屏幕中,我还希望所有列仅显示在一行中,并且可以通过水平滚动访问其他列。
<Grid
container
spacing={2}
style={{
maxHeight: "100vh",
overflowY: "auto",
overflowX: "hidden",
height: "440px",
overflow: "auto",
}}
>
<Grid item xs={2.1}>
{cards.map((card) => <Card props={card} /> )}
</Grid>
</Grid>
【问题讨论】:
标签: css reactjs material-ui grid