mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-10 11:03:19 +08:00

* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
79 lines
1.7 KiB
Markdown
79 lines
1.7 KiB
Markdown
---
|
|
order: 5
|
|
title:
|
|
zh-CN: 对齐
|
|
en-US: Alignment
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
子元素垂直对齐。
|
|
|
|
## en-US
|
|
|
|
Child elements vertically aligned.
|
|
|
|
```jsx
|
|
import { Row, Col, Divider } from 'antd';
|
|
|
|
const DemoBox = props => <p className={`height-${props.value}`}>{props.children}</p>;
|
|
|
|
export default () => (
|
|
<>
|
|
<Divider orientation="left">Align Top</Divider>
|
|
<Row justify="center" align="top">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
|
|
<Divider orientation="left">Align Middle</Divider>
|
|
<Row justify="space-around" align="middle">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
|
|
<Divider orientation="left">Align Bottom</Divider>
|
|
<Row justify="space-between" align="bottom">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
</>
|
|
);
|
|
```
|
|
|
|
```css
|
|
#components-grid-demo-flex-align [class~='ant-row'] {
|
|
background: rgba(128, 128, 128, 0.08);
|
|
}
|
|
```
|