Files
freeCodeCamp/curriculum/challenges/russian/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.russian.md

2.3 KiB
Raw Blame History

id, title, challengeType, videoUrl, forumTopicId, localeTitle
id title challengeType videoUrl forumTopicId localeTitle
587d78ae367417b2b2512aff Use the order Property to Rearrange Items 0 https://scrimba.com/p/pVaDAv/cMbvNAG 301116 Используйте свойство Order для переупорядочения элементов

Description

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

Instructions

Добавьте order свойств CSS в #box-1 и #box-2 . Дайте #box-1 значение 2 и дайте #box-2 значение 1.

Tests

tests:
  - text: The <code>#box-1</code> element should have the <code>order</code> property set to a value of 2.
    testString: assert($('#box-1').css('order') == '2');
  - text: The <code>#box-2</code> element should have the <code>order</code> property set to a value of 1.
    testString: assert($('#box-2').css('order') == '1');

Challenge Seed

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

    height: 200px;
    width: 200px;
  }

  #box-2 {
    background-color: orangered;

    height: 200px;
    width: 200px;
  }
</style>

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

Solution

<style>
  #box-container {
    display: flex;
    height: 500px;
  }
  #box-1 {
    background-color: dodgerblue;
    order: 2;
    height: 200px;
    width: 200px;
  }

  #box-2 {
    background-color: orangered;
    order: 1;
    height: 200px;
    width: 200px;
  }
</style>

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