---
id: 5a94fe2669fb03452672e45e
title: Use grid-area Without Creating an Areas Template
challengeType: 0
videoUrl: ''
localeTitle: 使用网格区域而不创建区域模板
---
## Description
您在上一次挑战中学习的grid-area
属性可以以其他方式使用。如果您的网格没有要引用的区域模板,您可以动态创建一个区域,以便放置项目,如下所示: item1 {grid-area:1/1/2/4; }
这是使用您之前了解的行号来定义此项目的区域。上例中的数字代表以下值: 网格区域:水平线开始于/垂直线开始于/水平线结束于/垂直线结束于;
因此,示例中的项目将使用第1行和第2行之间的行以及第1行和第4行之间的行。
## Instructions
使用grid-area
属性,将item5
类的元素item5
第三和第四条水平线之间以及第一条和第四条垂直线之间。
## Tests
```yml
tests:
- text: item5
类应该具有值为3/1/4/4
的grid-area
属性。
testString: 'assert(code.match(/.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi), "item5
class should have a grid-area
property that has the value of 3/1/4/4
.");'
```
## Challenge Seed
## Solution
```js
// solution required
```