遵循 MUI 文档:https://mui.com/material-ui/react-stack/我认为将某些东西垂直和水平居中所需的只是包含justifyContent='center' alignItems='center
,但这仅将其水平居中而不是垂直居中。我只是想在纸张组件中水平和垂直对齐它。
任何帮助,将不胜感激:
<Paper
elevation={2}
sx={{
minWidth: '30%%',
height: '100%',
}}
>
<Box
display='flex'
justifyContent='center'
alignItems='center'
>
<Typography>0</Typography>
</Box>
</Paper>