curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af0.md
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.
Add the CSS property display to #box-container and set its value to flex.
#box-container should have the display property set to a value of flex.
const boxContainer = document.querySelector('#box-container');
const displayStyle = window.getComputedStyle(boxContainer)['display'];
assert.strictEqual(displayStyle, 'flex');
<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>
<style>
#box-container {
height: 500px;
display: flex;
}
#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>