ant-design/components/grid/demo/gutter.md

33 lines
974 B
Markdown
Raw Normal View History

## zh-CN
2020-08-05 11:28:57 +08:00
栅格常常需要和间隔进行配合,你可以使用 `Row``gutter` 属性,我们推荐使用 `(16+8n)px` 作为栅格间隔(n 是自然数)。
2016-02-23 17:34:46 +08:00
2017-11-01 18:33:41 +08:00
如果要支持响应式,可以写成 `{ xs: 8, sm: 16, md: 24, lg: 32 }`
如果需要垂直间距,可以写成数组形式 `[水平间距, 垂直间距]` `[16, { xs: 8, sm: 16, md: 24, lg: 32 }]`
> 数组形式垂直间距在 `3.24.0` 之后支持。
## en-US
2020-08-05 11:28:57 +08:00
You can use the `gutter` property of `Row` as grid spacing, we recommend set it to `(16 + 8n) px` (`n` stands for natural number).
2017-11-01 18:33:41 +08:00
You can set it to a object like `{ xs: 8, sm: 16, md: 24, lg: 32 }` for responsive design.
You can use an array to set vertical spacing, `[horizontal, vertical]` `[16, { xs: 8, sm: 16, md: 24, lg: 32 }]`.
> vertical gutter was supported after `3.24.0`.
2019-05-07 14:57:32 +08:00
```css
2016-02-23 17:34:46 +08:00
.gutter-box {
padding: 8px 0;
2019-05-07 14:57:32 +08:00
background: #00a0e9;
2016-02-23 17:34:46 +08:00
}
2019-05-07 14:57:32 +08:00
```
2019-12-24 15:01:03 +08:00
<style>
[data-theme="dark"] .gutter-box {
background: #028ac8;
}
</style>