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

31 lines
658 B
Markdown
Raw Normal View History

2015-06-18 15:26:29 +08:00
# 左右偏移
2015-06-09 21:20:15 +08:00
- order: 2
2015-06-09 21:20:15 +08:00
2015-06-15 17:46:42 +08:00
列偏移。
2015-06-09 21:20:15 +08:00
2015-10-15 00:10:01 +08:00
使用 `.col-offset-*` 类可以将列向右侧偏。例如,`.col-offset-4` 类将 `.col-4` 元素向右侧偏移了4个列column的宽度。
2015-06-09 21:20:15 +08:00
---
2015-10-27 23:52:17 +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>
<Col span="8" offset="8">.col-8</Col>
</Row>
<Row>
<Col span="6" offset="6">.col-6 .col-offset-6</Col>
<Col span="6" offset="6">.col-6 .col-offset-6</Col>
</Row>
<Row>
<Col span="12" offset="6">.col-12 .col-offset-6</Col>
</Row>
</div>,
document.getElementById('components-layout-demo-offset')
);
2015-06-09 21:20:15 +08:00
````