---
id: 587d78ae367417b2b2512afc
title: Use the flex-grow Property to Expand Items
challengeType: 0
videoUrl: ''
localeTitle: 使用flex-grow属性扩展项目
---
## Description
与flex-shrink
相反的是flex-grow
属性。回想一下,当容器缩小时, flex-shrink
控制项目的大小。当父容器展开时, flex-grow
属性控制项的大小。使用上一个挑战中的类似示例,如果一个项目的flex-grow
值为1而另一个项目的flex-grow
值为3,则值为3的项目将增长为另一个项目的三倍。
## Instructions
将CSS属性flex-grow
添加到#box-1
和#box-2
。将#box-1
的值设为1,将#box-2
的值设为2。
## Tests
```yml
tests:
- text: '#box-1
元素应将flex-grow
属性设置为值1。'
testString: 'assert($("#box-1").css("flex-grow") == "1", "The #box-1
element should have the flex-grow
property set to a value of 1.");'
- text: '#box-2
元素应将flex-grow
属性设置为值2。'
testString: 'assert($("#box-2").css("flex-grow") == "2", "The #box-2
element should have the flex-grow
property set to a value of 2.");'
```
## Challenge Seed
## Solution
```js
// solution required
```