Files
freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-column.chinese.md

77 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 587d78ac367417b2b2512af4
title: Use the flex-direction Property to Make a Column
challengeType: 0
videoUrl: 'https://scrimba.com/p/pVaDAv/cZmWeA4'
forumTopicId: 301109
localeTitle: 使用 flex-direction 属性创建一列
---
## Description
<section id='description'>
之前两个挑战使用<code>flex-direction</code>属性创建行row。这个属性还能创建一个列让子元素垂直排列在 flex 容器中。
</section>
## Instructions
<section id='instructions'>
<code>#box-container</code>元素添加 CSS 属性<code>flex-direction</code>,赋值为 <code>column</code>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 column。
testString: assert($('#box-container').css('flex-direction') == 'column');
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<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>
```
</div>
</section>
## Solution
<section id='solution'>
```html
// solution required
```
</section>