flex-direction: column;
时间: 2023-10-14 07:11:25 浏览: 100
The `flex-direction: column;` is a CSS property that changes the direction of the flex container's main axis to be vertical. This means that the flex items will be stacked on top of each other within the container, rather than side by side.
Here’s an example of how to use it:
```
.container {
display: flex;
flex-direction: column;
}
```
In this example, the `flex-direction: column;` property is applied to the `.container` class, which is a flex container. This will cause the child elements of the container to be arranged vertically, from top to bottom.
Other possible values for `flex-direction` include `row`, `row-reverse`, and `column-reverse`. These values change the direction of the flex container's main axis to be horizontal, in reverse order, or vertical in reverse order, respectively.
阅读全文