1.6 KiB
1.6 KiB
id, challengeType, videoUrl, forumTopicId, title
id | challengeType | videoUrl | forumTopicId | title |
---|---|---|---|---|
587d78ab367417b2b2512af2 | 0 | https://scrimba.com/p/pVaDAv/cBEkbfJ | 301110 | 使用 flex-direction 属性创建一行 |
Description
display: flex
属性使其变成 flex 容器。只要给父元素添加flex-direction
属性,并把属性值设置为 row 或 column,即可横排或竖排它的子元素。设为 row 可以让子元素水平排列,设为 column 可以让子元素垂直排列。
flex-direction
的其他可选值还有 row-reverse 和 column-reverse。
注意flex-direction
的默认值为 row。
Instructions
#box-container
添加 CSS 属性flex-direction
,其值设为 row-reverse。
Tests
tests:
- text: '<code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 row-reverse。'
testString: assert($('#box-container').css('flex-direction') == 'row-reverse');
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
// solution required