---
id: 587d78ad367417b2b2512afa
title: Use the flex-wrap Property to Wrap a Row or Column
challengeType: 0
videoUrl: ''
localeTitle: 使用flex-wrap属性包装行或列
---
## Description
CSS flexbox具有将flex项分割为多行(或列)的功能。默认情况下,Flex容器将所有Flex项目放在一起。例如,一行将全部在一行上。但是,使用flex-wrap
属性,它会告诉CSS包装项目。这意味着额外的项目将移动到新的行或列中。包装发生的断点取决于物品的大小和容器的大小。 CSS还有包装方向的选项: -
nowrap
:这是默认设置,不包装项目。 -
wrap
:如果项目在一行中,则从左到右包装,如果它们在列中,则从上到下包装。 -
wrap-reverse
:如果项目在一行中,则从下到上包装项目;如果它们在列中,则从右到左包装。
## Instructions
当前布局对于一行有太多的框。将CSS属性flex-wrap
添加到#box-container
元素,并为其赋值wrap。
## Tests
```yml
tests:
- text: '#box-container
元素应该将flex-wrap
属性设置为wrap值。'
testString: 'assert($("#box-container").css("flex-wrap") == "wrap", "The #box-container
element should have the flex-wrap
property set to a value of wrap.");'
```
## Challenge Seed
## Solution
```js
// solution required
```