【发布时间】:2019-06-10 10:24:13
【问题描述】:
如何在纸容器内的排版标签旁边放置一个按钮,与右/尾对齐?
<div className={classes.root}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Paper className={classes.paper}>
<Typography inline>CPU</Typography>
<IconButton className={classes.button} aria-label="Add" size="medium" ><AddIcon /></IconButton>
</Paper>
</Grid>
</div>
这是我的风格:
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
padding: theme.spacing(2),
flexGrow: 1,
},
paper: {
padding: theme.spacing(2),
color: theme.palette.text.secondary,
}
}));
我正在使用 Typography 的 inline 属性,但按钮继续在下一行...非常感谢,我是新手。
【问题讨论】:
标签: reactjs material-ui material-design typography