freeCodeCamp/curriculum/challenges/russian/01-responsive-web-design/css-flexbox/use-the-flex-direction-prop...

2.0 KiB
Raw Blame History

id title challengeType videoUrl forumTopicId localeTitle
587d78ac367417b2b2512af4 Use the flex-direction Property to Make a Column 0 https://scrimba.com/p/pVaDAv/cZmWeA4 301109 Используйте свойство flex-direction для создания столбца

Description

В предыдущих задачах свойство flex-direction использовалось для создание рядов. С помощью этого свойства также можно создавать столбцы, размещая дочерние элементы "гибкого" контейнера вертикально один под другим.

Instructions

Добавьте CSS свойство flex-direction к элементу #box-container и задайте ему значение column.

Tests

tests:
  - text: The <code>#box-container</code> element should have a <code>flex-direction</code> property set to column.
    testString: assert($('#box-container').css('flex-direction') == 'column');

Challenge Seed

<style>
  #box-container {
    display: flex;
    height: 500px;

  }
  #box-1 {
    background-color: dodgerblue;
    width: 50%;
    height: 50%;
  }

  #box-2 {
    background-color: orangered;
    width: 50%;
    height: 50%;
  }
</style>

<div id="box-container">
  <div id="box-1"></div>
  <div id="box-2"></div>
</div>

Solution

<style>
  #box-container {
    display: flex;
    height: 500px;
    flex-direction: column;
  }
  #box-1 {
    background-color: dodgerblue;
    width: 50%;
    height: 50%;
  }

  #box-2 {
    background-color: orangered;
    width: 50%;
    height: 50%;
  }
</style>

<div id="box-container">
  <div id="box-1"></div>
  <div id="box-2"></div>
</div>