Files
freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-column.md
Oliver Eyton-Williams dec409a4bd fix: s/localeTitle/title/g
2020-10-06 23:10:08 +05:30

1.3 KiB
Raw Blame History

id, challengeType, videoUrl, forumTopicId, title
id challengeType videoUrl forumTopicId title
587d78ac367417b2b2512af4 0 https://scrimba.com/p/pVaDAv/cZmWeA4 301109 使用 flex-direction 属性创建一列

Description

之前两个挑战使用flex-direction属性创建行row。这个属性还能创建一个列让子元素垂直排列在 flex 容器中。

Instructions

#box-container元素添加 CSS 属性flex-direction,赋值为 column

Tests

tests:
  - text: <code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 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

// solution required