flex-direction: column;
时间: 2023-11-01 11:41:00 浏览: 79
The CSS property "flex-direction: column" is used to change the direction of flex items in a container. By default, the flex direction is set to "row" which means that the flex items are placed horizontally in a row.
When "flex-direction: column" is applied to a container, the flex items are stacked vertically from top to bottom. This means that the main axis of the container is now vertical instead of horizontal.
Here's an example of how to use "flex-direction: column" in CSS:
.container {
display: flex;
flex-direction: column;
}
In this example, the ".container" class is set to display as a flex container and the flex direction is set to column. This will stack the flex items vertically in the container.
阅读全文