【发布时间】:2021-03-31 05:15:39
【问题描述】:
我很难理解如何正确使用 Material UI 的 flexbox 整数:
这样我可以按照我想要的方式对齐项目:
export default function Home() {
return (
<Grid container justify={"space-between"}>
<Grid item>
<Typography>Left text</Typography>
</Grid>
<Grid item>
<Typography>Right text</Typography>
</Grid>
</Grid>
);
}
但我希望这也应该有效:
export default function Home() {
return (
<Grid container>
<Grid item xs={6} justify={"flex-start"}>
<Typography>Left text</Typography>
</Grid>
<Grid item xs={6} justify={"flex-end"}>
<Typography>Right text</Typography>
</Grid>
</Grid>
);
}
但后者并没有达到预期的结果。我在这里错过了什么?
【问题讨论】:
标签: html css flexbox material-ui