【问题标题】:How do you change(make it larger) the size of an icon inside a GRID in reactjs/material-ui?你如何在 reactjs/material-ui 的 GRID 中更改(使其变大)图标的大小?
【发布时间】:2021-06-08 22:30:15
【问题描述】:

我已经有了我想要的图标大小,但是在将这个图标包含在<Grid item> </Grid> 中之后,图标的大小变得更小了。我希望大小几乎和Grid 容器一样大。

如果您能帮助我,我将不胜感激;我用谷歌搜索了我的问题,但找不到答案;谢谢。

代码如下:

 <Grid container className={classes.bannerRoot}>
   <Grid item>
     <InboxIcon style={{ fontsize: 200 }} /> 
   </Grid>
 </Grid>

bannerRoot 在哪里:


const useStyles = makeStyles((theme) => ({
  root: {
    paddingLeft: theme.spacing(6),
  },
  bannerRoot: {
    backgroundColor: 'white',
    marginTop: theme.spacing(4),
    minHeight: '225px',
    paddingLeft: theme.spacing(3),
    paddingTop: theme.spacing(4),
  },
}));

【问题讨论】:

    标签: reactjs material-ui jsx


    【解决方案1】:

    你的 fontSize 有拼写错误:

    export function OpenDialogue() {
    const classes = useStyles();
    return (
        <Grid container className={classes.bannerRoot}>
            <Grid item>
                <LaunchIcon style={{ fontSize: 200 }} />
            </Grid>
        </Grid>
    )
    

    }

    【讨论】:

    • 是的,我刚刚注意到了。
    猜你喜欢
    • 2021-01-29
    • 2021-01-20
    • 2016-07-16
    • 2020-05-11
    • 2019-03-29
    • 2016-08-02
    • 2020-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多