---
id: 5a94fe8569fb03452672e464
title: Create Grids within Grids
challengeType: 0
videoUrl: ''
localeTitle: 在网格中创建网格
---
## Description
将元素转换为网格只会影响其直接后代的行为。因此,通过将直接后代转换为网格,您在网格中有一个网格。例如,通过使用item3
类设置元素的display
和grid-template-columns
属性,可以在网格中创建网格。
## Instructions
使用item3
类将元素转换为网格,其中两列的宽度为auto
, 1fr
使用display
和grid-template-columns
。
## 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), "item3
class should have a grid-template-columns
property with auto
and 1fr
as values.");'
- text: item3
类应该具有grid
值的display
属性。
testString: 'assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi), "item3
class should have a display
property with the value of grid
.");'
```
## Challenge Seed
## Solution
```js
// solution required
```