---
id: 5a94fe8569fb03452672e464
challengeType: 0
videoUrl: 'https://scrimba.com/p/pByETK/c6N78Ap'
forumTopicId: 301128
localeTitle: 在网格中创建网格
---
## Description
将元素转换为网格只会影响其子代元素。因此,在把某个子代元素设置为网格后,就会得到一个嵌套的网格。
例如,设置类为item3
的元素的display
和grid-template-columns
属性,就会得到一个嵌套的网格。
## Instructions
用display
和grid-template-columns
,使类为item3
元素转换为有两列且宽度为auto
和1fr
的网格。
## Tests
```yml
tests:
- text: 'item3
类应该有grid-template-columns
属性且值为auto
和1fr
。'
testString: assert(code.match(/.item3\s*?{[\s\S]*grid-template-columns\s*?:\s*?auto\s*?1fr\s*?;[\s\S]*}/gi));
- text: 'item3
类有display
属性且值为grid
。'
testString: assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
```
## Challenge Seed
## Solution
```js
// solution required
```