2018-10-10 18:03:03 -04:00
---
id: 5a858944d96184f06fd60d61
title: Create Your First CSS Grid
challengeType: 0
2019-08-28 16:26:13 +03:00
videoUrl: https://scrimba.com/p/pByETK/cqwREC4
forumTopicId: 301129
2018-11-02 22:57:37 +05:00
localeTitle: Создайте свой первый CSS Grid
2018-10-10 18:03:03 -04:00
---
## Description
2019-08-28 16:26:13 +03:00
< section id = 'description' >
Чтобы превратить любой HTML элемент в грид контейнер установите свойство < code > display< / code > в < code > grid< / code > . Это даёт вам возможность использовать другие свойства, связанные с CSS Grid. < strong > Примечание< / strong > < br > В CSS Grid родительский элемент называется < dfn > контейнером,< / dfn > а е г о дочерние элементы называются < dfn > элементами< / dfn > .
< / section >
2018-10-10 18:03:03 -04:00
## Instructions
2019-08-28 16:26:13 +03:00
< section id = 'instructions' >
Измените свойство display у элемента div с классом < code > container< / code > на < code > grid< / code > .
< / section >
2018-10-10 18:03:03 -04:00
## Tests
< section id = 'tests' >
```yml
tests:
2019-08-28 16:26:13 +03:00
- text: < code > container</ code > class should have a < code > display</ code > property with a value of < code > grid</ code > .
testString: assert(code.match(/.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi));
2018-10-10 18:03:03 -04:00
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'html-seed' >
```html
< style >
.d1{background:LightSkyBlue;}
.d2{background:LightSalmon;}
.d3{background:PaleTurquoise;}
.d4{background:LightPink;}
.d5{background:PaleGreen;}
.container {
font-size: 40px;
width: 100%;
background: LightGray;
/* add your code below this line */
/* add your code above this line */
}
< / style >
< div class = "container" >
< div class = "d1" > 1< / div >
< div class = "d2" > 2< / div >
< div class = "d3" > 3< / div >
< div class = "d4" > 4< / div >
< div class = "d5" > 5< / div >
< / div >
```
< / div >
< / section >
## Solution
< section id = 'solution' >
2019-08-28 16:26:13 +03:00
```html
var code = ".container {display: grid;}"
2018-10-10 18:03:03 -04:00
```
2019-08-28 16:26:13 +03:00
2018-10-10 18:03:03 -04:00
< / section >