---
id: 587d78ae367417b2b2512afd
title: Use the flex-basis Property to Set the Initial Size of an Item
challengeType: 0
videoUrl: https://scrimba.com/p/pVaDAv/c3d9nCa
forumTopicId: 301108
localeTitle: Используйте свойство flex-basis для установки начального размера элемента
---
## Description
Свойство flex-basis
указывает начальный размер элемента до того, как CSS выполнит корректировки с flex-shrink
или flex-grow
. Единицы, используемые свойством flex-basis
такие же, как и другие свойства размера ( px
, em
, %
и т. Д.). Значение auto
определяет размеры элементов на основе содержимого.
## Instructions
Установите начальный размер ящиков с использованием flex-basis
. Добавьте свойство CSS flex-basis
как в #box-1
и в #box-2
. Дайте #box-1
значение 10em
и #box-2
значение 20em
.
## Tests
```yml
tests:
- text: The #box-1
element should have a flex-basis
property.
testString: assert($('#box-1').css('flex-basis') != 'auto');
- text: The #box-1
element should have a flex-basis
value of 10em
.
testString: assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g));
- text: The #box-2
element should have the flex-basis
property.
testString: assert($('#box-2').css('flex-basis') != 'auto');
- text: The #box-2
element should have a flex-basis
value of 20em
.
testString: assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g));
```
## Challenge Seed
## Solution