align-items
时间: 2023-09-30 10:06:28 浏览: 44
The CSS property `align-items` is used to specify the vertical alignment of items within a container. It defines how the items should be aligned along the cross axis of the container.
Possible values for `align-items` are:
- `stretch`: The default value. Items are stretched to fill the container vertically.
- `flex-start`: Items are aligned at the top of the container.
- `flex-end`: Items are aligned at the bottom of the container.
- `center`: Items are centered vertically within the container.
- `baseline`: Items are aligned on their baselines (the line that defines the letters' height) within the container.
Example:
```css
.container {
display: flex;
align-items: center;
}
```
In this example, the items within the container will be centered vertically.