align-items:
时间: 2023-09-14 18:04:30 浏览: 46
The CSS property "align-items" is used to align the flex items along the cross axis of the flex container. It sets the default alignment for all the flex items, unless overridden by the "align-self" property.
The possible values for "align-items" are:
- flex-start: aligns the flex items at the start of the cross axis
- flex-end: aligns the flex items at the end of the cross axis
- center: aligns the flex items at the center of the cross axis
- baseline: aligns the flex items at the baseline of the cross axis
- stretch: stretches the flex items to fill the cross axis
Example usage:
.container {
display: flex;
align-items: center; /* aligns the items at the center of the cross axis */
}