【发布时间】:2022-12-02 06:28:28
【问题描述】:
I'm trying to get only 2 items per row but I keep getting them all on the same row.
return (
<div>
<Grid container item xs={12} spacing={-1}>
...
<Grid container item spacing={2}>
...
<h1> Uspar</h1>
<Box sx={{ width: '100%' }}>
<Box className={classes.productsWrapper}>
{PRODUCTS.map((item, index) => (
<Button className={classes.productItem} key={index}>
<img className={classes.productImage} src={item.img} />
<h1> {item.Title}</h1>
<h2> {item.Subtitle}</h2>
<Typography variant="body1">{item.description}</Typography>
</Button>
))}
</Box>
</Box>
</Grid>
</Grid>
</div>
);
}
I have tried
grit item xs{6}
etc.
【问题讨论】:
-
codesandbox.io/s/quiet-worker-xbtfi6?file=/src/App.js this is what i get now
标签: material-ui react-tsx