Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox_basics_fix #23078

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ L'axe principal est défini par la propriété `flex-direction` qui peut prendre

Si on choisit la valeur `row` ou `row-reverse`, l'axe principal sera aligné avec la direction « en ligne » (_inline_ direction) (c'est la direction logique qui suit le sens d'écriture du document).

![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.png)
![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.svg)

Si on choisit la valeur `column` ou `column-reverse`, l'axe principal suivra la direction de bloc (_block direction_) et progressera le long de l'axe perpendiculaire au sens d'écriture.

![If flex-direction is set to column the main axis runs in the block direction.](basics2.png)
![If flex-direction is set to column the main axis runs in the block direction.](basics2.svg)

### L'axe secondaire (_cross axis_)

L'axe secondaire est perpendiculaire à l'axe principal. Ainsi, si `flex-direction` vaut `row` ou `row-reverse`, l'axe secondaire suivra l'axe des colonnes.

![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.png)
![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.svg)

Si l'axe principale est `column` ou `column-reverse`, l'axe secondaire suivra celui des lignes (horizontales).

![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.png)
![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.svg)

Comprendre les liens entre les différents axes est crucial lorsqu'on commence à aligner/justifier des éléments flexibles sur un axe ou l'autre grâce aux fonctionnalités et propriétés des boîtes flexibles.

Expand All @@ -50,11 +50,11 @@ Nous verrons plus tard les détails des relations entre les spécifications des

Si `flex-direction` vaut `row` et que nous travaillons sur un document écrit en français, la ligne de début de l'axe principal sera située à gauche et la ligne de fin sera située à droite.

![Working in English the start edge is on the left.](basics5.png)
![Working in English the start edge is on the left.](basics5.svg)

Si on travaille sur un document écrit dans une langue arabe, la ligne de début de l'axe principal sera à droite et la ligne de fin à gauche.

![The start edge in a RTL language is on the right.](basics6.png)
![The start edge in a RTL language is on the right.](basics6.svg)

Dans les deux cas, la ligne de début de l'axe secondaire est située en haut et la ligne de fin de cet axe est située en bas car ces deux langues sont écrites horizontalement.

Expand Down Expand Up @@ -119,7 +119,7 @@ Avant de revenir à ces propriétés, il nous faut définir le concept d'**espac

Prenons un conteneur de 500 pixels de large et qui contient trois éléments de 100 pixels de large. Il faut donc 300 pixels pour disposer ces éléments et il reste ainsi 200 pixels d'espace disponible. Si on ne modifie pas les valeurs initiales, l'espace disponible sera placé après le dernier élément.

![This flex container has available space after laying out the items.](basics7.png)
![This flex container has available space after laying out the items.](basics7.svg)

Si on préfère que les éléments s'étirent pour occuper l'espace restant, il nous faut une méthode pour distribuer cet espace parmi les éléments. C'est le rôle des propriétés `flex-` qui s'appliquent aux éléments.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ flexbox를 다루려면 주축과 교차축이라는 두 개의 축에 대한

`row` 혹은 `row-reverse`를 선택하면 주축은 **인라인 방향**으로 행을 따릅니다.

![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.png)
![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.svg)

`column` 혹은 `column-reverse` 을 선택하면 주축은 페이지 상단에서 하단으로 **블록 방향**을 따릅니다.

![If flex-direction is set to column the main axis runs in the block direction.](basics2.png)
![If flex-direction is set to column the main axis runs in the block direction.](basics2.svg)

### 교차축

교차축은 주축에 수직하므로, 만약 `flex-direction`(주축)이 `row` 나 `row-reverse` 라면 교차축은 열 방향을 따릅니다.

![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.png)
![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.svg)

주축이 `column` 혹은 `column-reverse` 라면 교차축은 행 방향을 따릅니다.

![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.png)
![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.svg)

flex 요소를 정렬하고 끝을 맞추(justify)려면 어느 축이 어느 방향인지 이해하는 것이 중요합니다; flexbox는 주축, 교차축을 따라 항목을 정렬하고 끝을 맞추는 각종 속성들을 적용하는 방식으로 동작합니다.

Expand All @@ -50,11 +50,11 @@ flexbox가 쓰기 방법(writing mode)을 가정하지 않는다는 것은 상

`flex-direction`이 `row`고 영어 문장을 문서에 쓰고 있다면, 주축의 시작선은 왼쪽 끝, 끝선은 오른쪽 끝이 될 것입니다.

![Working in English the start edge is on the left.](basics5.png)
![Working in English the start edge is on the left.](basics5.svg)

아랍어 문장을 쓰고 있다면, 주축의 시작선은 오른쪽 끝, 끝 선은 왼쪽 끝이 될 것입니다.

![The start edge in a RTL language is on the right.](basics6.png)
![The start edge in a RTL language is on the right.](basics6.svg)

영어와 아랍어는 모두 가로 쓰기를 채택하고 있으므로 두 예시에서 교차축의 시작선은 **flex 컨테이너**의 위 끝이며 끝선은 아래 끝입니다.

Expand Down Expand Up @@ -117,7 +117,7 @@ flexbox는 1차원 모델이지만 **flex 항목**이 여러 행에 나열되도

500 픽셀의 크기를 갖는 **flex 컨테이너** 내에 100 픽셀 크기의 자식 세 개가 존재할 때, **사용가능한 공간** 200 픽셀이 남게 됩니다. 기본적으로 flexbox는 이 공간을 마지막 자식 요소 다음에 빈공간으로 남겨둡니다.

![This flex container has available space after laying out the items.](basics7.png)
![This flex container has available space after laying out the items.](basics7.svg)

위의 세 가지 속성을 변경한다는 것은 **flex 항목**에게 **사용가능한 공간**을 분배하는 방식을 변경하는 것입니다. **사용가능한 공간** 개념은 **flex 항목**을 정렬할 때 특히 중요합니다.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ Conforme descrito acima, a propriedade `flex-direction` define a direção do ei

Se o valor escolhido for `row` (linha) ou `row-reverse` (linha reversa), seu eixo principal se moverá ao longo da linha — na **direção inline**.

![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.png)
![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.svg)

Se o valor escolhido for `column` (coluna) ou `column-reverse` (coluna reversa) e o eixo principal se moverá do topo até o fim da página — na **direção block**.

![If flex-direction is set to column the main axis runs in the block direction.](basics2.png)
![If flex-direction is set to column the main axis runs in the block direction.](basics2.svg)

### Eixo transversal

O eixo transversal é perpendicular ao eixo principal, logo, se a propriedade `flex-direction` estiver definida nas linhas, como `row` ou `row-reverse`, o eixo transversal estará na direção das colunas, como `column` ou `column-reverse`.

![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.png)
![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.svg)

Se o eixo principal for definido nas colunas, como `column` ou `column-reverse`, então o eixo transversal estará na direção das linhas, como `row` ou `row-reverse`.

![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.png)
![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.svg)

Compreender a diferença entre os eixos principal e perpendicular é o que importa quando começamos a observar o alinhamento ou justificação dos itens flexíveis (flex items); o _flexbox_ possui propriedades que alinham e justificam o conteúdo ao longo de um eixo ou de outro.

Expand All @@ -50,11 +50,11 @@ Essa discussão sobre a relação entre o _flexbox_ e a especificação do modo

Se o valor da propriedade `flex-direction` for `row (linha)`, considerando o estilo de escrita ocidental, a borda inicial do eixo principal estará localizada à esquerda e a borda final, à direita.

![Working in English the start edge is on the left.](basics5.png)
![Working in English the start edge is on the left.](basics5.svg)

Considerando um idioma como o Árabe, que possui um estilo de escrita oriental, teremos o inverso: a borda inicia do eixo principal estará localizada à direita e a borda final, à esquerda.

![The start edge in a RTL language is on the right.](basics6.png)
![The start edge in a RTL language is on the right.](basics6.svg)

Em ambos os casos, a borda inicial do eixo transversal está na parte superior do contêiner flex e a borda final, na parte inferior, visto que ambos os idiomas têm um estilo de de escrita horizontal.

Expand Down Expand Up @@ -119,7 +119,7 @@ Antes que essas propriedades possam fazer sentido, é preciso compreender o conc

Conforme o exemplo abaixo, se houver três elementos com 100 pixels de comprimento em um contêiner de 500 pixels, então o espaço total necessário para acomodá-los será de 300 pixels. Desse modo, sobrarão 200 pixels de espaço útil. Se os valores iniciais não forem modificados, então o _flexbox_ posicionará esse espaço após o último item.

![This flex container has available space after laying out the items.](basics7.png)
![This flex container has available space after laying out the items.](basics7.svg)

Se for necessário que os elementos cresçam proprocionamente ou não e preencham o espaço disponível, deverá haver método que faça essa distribuição espacial entre eles, conforme será visto nas seções subsequentes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ slug: Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox

Если вы выберете `row` или `row-reverse`, ваша главная ось будет проходить в горизонтальном направлении **(inline direction)**.

![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.png)
![If flex-direction is set to row the main axis runs along the row in the inline direction.](basics1.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

Если вы выберете `column` или `column-reverse`, ваша главная ось будет проходить в вертикальном направлении **(block direction)**.

![If flex-direction is set to column the main axis runs in the block direction.](basics2.png)
![If flex-direction is set to column the main axis runs in the block direction.](basics2.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

### Побочная ось

Побочная ось проходит перпендикулярно главной оси, поэтому, если свойство `flex-direction` (главная ось) задано как `row` или `row-reverse`, побочная ось будет проходить в вертикальном направлении.

![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.png)
![If flex-direction is set to row then the cross axis runs in the block direction.](basics3.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

Если свойство `flex-direction` задано как `column` или `column-reverse`, побочная ось будет проходить в горизонтальном направлении.

![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.png)
![If flex-direction is set to column then the cross axis runs in the inline direction.](basics4.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

Понимание того, с какой осью вы работаете (главная или побочная) очень важно для дальнейшего изучения Flexbox.

Expand All @@ -50,11 +50,11 @@ slug: Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox

Если свойству `flex-direction` задано значение `row` и вы работаете с английским языком, то начало главной оси будет слева, а конец главной оси – справа.

![Working in English the start edge is on the left.](basics5.png)
![Working in English the start edge is on the left.](basics5.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

Если бы вы работаете с арабским языком, то начало главной оси будет справа, а конец главной оси – слева.

![The start edge in a RTL language is on the right.](basics6.png)
![The start edge in a RTL language is on the right.](basics6.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

В обоих случаях начало побочной оси находится вверху flex контейнера, а конец – внизу, поскольку оба языка имеют режим горизонтальной записи.

Expand Down Expand Up @@ -119,7 +119,7 @@ slug: Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox

Если наш контейнер шириной 500 пикселей содержит три элемента шириной 100 пикселей каждый, для их размещения нам потребуется пространство шириной в 300 пикселей. Остаётся 200 пикселей свободного пространства. Если мы не изменим исходные значения этих свойств, флексбокс разместит это пространство за последним элементом.

![This flex container has available space after laying out the items.](basics7.png)
![This flex container has available space after laying out the items.](basics7.svg)
PJW980921 marked this conversation as resolved.
Show resolved Hide resolved

Если вместо этого мы хотим чтобы элементы росли и заполняли собой свободное пространство, нам нужно указать способ распределения оставшегося пространства между элементами. Это как раз то для чего предназначены `flex` свойства.

Expand Down