简体   繁体   English

反应如何扩大间距

[英]React how to expand spacing

I'm using Grid from @material-ui to display my data . 我正在使用@material-ui Grid来显示我的数据。 Inside this Grid, I have multiple other grids, each represent a different section . 在此网格内部,我还有多个其他网格,每个网格代表一个不同的部分。 I've use container spacing attribute of Grid, and gave it the max value possible (40) , but I need the spacing to be a litter bigger, and I can't figure how to do it.. 我使用了Grid的container spacing属性,并为其提供了最大值(40),但是我需要使该间距更大,而且我不知道该怎么做。

  <Paper className={this.props.classes.root}>
  <Grid container spacing={40} >
    <Grid item sm={6}>
      ..
    </Grid>
    <Grid item sm={2}>
      ..
    </Grid>
    <Grid item sm={4}>
    ..
    </Grid>
  </Grid>
  </Paper>

How can I expand the spacing ? 如何扩大间距?

Normally spacing props add padding between the elements in the grid. 通常, spacing道具会在网格中的元素之间添加填充。 so you can use the className or inline style to achieve padding between elements. 因此您可以使用classNameinline样式来实现元素之间的填充。

Sample code give below for inline style. 下面的示例代码提供了内联样式。

<Grid container >
    <Grid item sm={6} style={{padding:'30px'}}>
      ..
    </Grid>
    <Grid item sm={2} style={{padding:'30px'}}>
      ..
    </Grid>
    <Grid item sm={4} style={{padding:'30px'}}>
    ..
    </Grid>
  </Grid>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM