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

46 lines
842 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 2
2016-11-05 15:46:50 +08:00
title:
zh-CN: 左右偏移
2016-11-05 15:46:50 +08:00
en-US: Column offset
2016-03-31 09:40:55 +08:00
---
2015-06-09 21:20:15 +08:00
## zh-CN
2015-06-15 17:46:42 +08:00
列偏移。
2015-06-09 21:20:15 +08:00
2016-02-25 14:15:37 +08:00
使用 `offset` 可以将列向右侧偏。例如,`offset={4}` 将元素向右侧偏移了 4 个列column的宽度。
2015-06-09 21:20:15 +08:00
## en-US
`Offset` can set the column to the right side. For example, using `offset = {4}` can set the element shifted to the right four columns width.
2019-05-07 14:57:32 +08:00
```jsx
import { Row, Col } from 'antd';
2015-10-27 23:52:17 +08:00
ReactDOM.render(
<div>
<Row>
<Col span={8}>col-8</Col>
2019-05-07 14:57:32 +08:00
<Col span={8} offset={8}>
col-8
</Col>
2015-10-27 23:52:17 +08:00
</Row>
<Row>
2019-05-07 14:57:32 +08:00
<Col span={6} offset={6}>
col-6 col-offset-6
</Col>
<Col span={6} offset={6}>
col-6 col-offset-6
</Col>
2015-10-27 23:52:17 +08:00
</Row>
<Row>
2019-05-07 14:57:32 +08:00
<Col span={12} offset={6}>
col-12 col-offset-6
</Col>
2015-10-27 23:52:17 +08:00
</Row>
</div>,
2019-05-07 14:57:32 +08:00
mountNode,
2015-10-27 23:52:17 +08:00
);
2019-05-07 14:57:32 +08:00
```