2021-06-15 16:21:20 +02:00
---
id: 587d78ab367417b2b2512af2
2021-06-26 21:42:30 +05:30
title: Usar a propriedade flex-direction para criar uma linha
2021-06-15 16:21:20 +02:00
challengeType: 0
videoUrl: 'https://scrimba.com/p/pVaDAv/cBEkbfJ'
forumTopicId: 301110
dashedName: use-the-flex-direction-property-to-make-a-row
---
# --description--
2021-06-26 21:42:30 +05:30
Ao adicionar `display: flex` a um elemento, você o transforma em um flex container. Isso faz com que seja possível alinhar todos os filhos desse elemento em linhas ou colunas. Para fazer isso, você deve usar a propriedade `flex-direction` no item pai e definir o valor desta usando row ou column. Criar uma row (linha) vai alinhar os itens filhos horizontalmente. Criar uma column (coluna) vai alinhar os itens filhos verticalmente.
2021-06-15 16:21:20 +02:00
2021-06-26 21:42:30 +05:30
Outras opções para `flex-direction` são `row-reverse` e `column-reverse` .
2021-06-15 16:21:20 +02:00
2021-06-26 21:42:30 +05:30
**Observação:** o valor padrão da propriedade `flex-direction` é `row` .
2021-06-15 16:21:20 +02:00
# --instructions--
2021-06-26 21:42:30 +05:30
Adicione a propriedade CSS `flex-direction` ao elemento de id `#box-container` e dê a ela o valor de `row-reverse` .
2021-06-15 16:21:20 +02:00
# --hints--
2021-06-26 21:42:30 +05:30
O elemento de id `#box-container` deve ter a propriedade `flex-direction` com o valor de `row-reverse` .
2021-06-15 16:21:20 +02:00
```js
assert($('#box -container').css('flex-direction') == 'row-reverse');
```
# --seed--
## --seed-contents--
```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 >
```
# --solutions--
```html
< style >
#box -container {
display: flex;
height: 500px;
flex-direction: row-reverse;
}
#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 >
```