freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/css-flexbox/use-display-flex-to-position-two-boxes.english.md
Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.5 KiB

id, title, challengeType, videoUrl
id title challengeType videoUrl
587d78ab367417b2b2512af0 Use display: flex to Position Two Boxes 0 https://scrimba.com/p/pVaDAv/cgz3QS7

Description

This section uses alternating challenge styles to show how to use CSS to position elements in a flexible way. First, a challenge will explain theory, then a practical challenge using a simple tweet component will apply the flexbox concept. Placing the CSS property display: flex; on an element allows you to use other flex properties to build a responsive page.

Instructions

Add the CSS property display to #box-container and set its value to flex.

Tests

tests:
  - text: <code>#box-container</code> should have the <code>display</code> property set to a value of flex.
    testString: assert($('#box-container').css('display') == 'flex', '<code>#box-container</code> should have the <code>display</code> property set to a value of flex.');

Challenge Seed

<style>
  #box-container {
    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

// solution required