문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
wiki:css:css_note:css_flex_container [2021/07/05 16:43] emblim98 [CSS Flex Container] |
wiki:css:css_note:css_flex_container [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 172: | 줄 172: | ||
| </ | </ | ||
| </ | </ | ||
| - | \\ | ||
| ===== Example ===== | ===== Example ===== | ||
| '' | '' | ||
| 줄 197: | 줄 196: | ||
| < | < | ||
| < | < | ||
| - | < | + | < |
| + | (from right to top):</ | ||
| <div class=" | <div class=" | ||
| < | < | ||
| 줄 293: | 줄 293: | ||
| </ | </ | ||
| </ | </ | ||
| - | \\ | ||
| ===== Example ===== | ===== Example ===== | ||
| '' | '' | ||
| 줄 337: | 줄 336: | ||
| </ | </ | ||
| </ | </ | ||
| - | \\ | ||
| ======The flex-flow Property====== | ======The flex-flow Property====== | ||
| '' | '' | ||
| {{: | {{: | ||
| - | ====Example==== | + | =====Example===== |
| <code css> | <code css> | ||
| 줄 384: | 줄 382: | ||
| </ | </ | ||
| </ | </ | ||
| - | \\ | ||
| ======The justify-content Property====== | ======The justify-content Property====== | ||
| '' | '' | ||
| {{: | {{: | ||
| - | ====Example==== | + | =====Example===== |
| '' | '' | ||
| <code css> | <code css> | ||
| 줄 763: | 줄 760: | ||
| </ | </ | ||
| - | </ | + | </ |
| + | \\ | ||
| + | \\ | ||
| ======The align-content Property====== | ======The align-content Property====== | ||
| '' | '' | ||
| 줄 864: | 줄 863: | ||
| </ | </ | ||
| ===== Example ===== | ===== Example ===== | ||
| - | '' | + | '' |
| {{: | {{: | ||
| <code css> | <code css> | ||
| 줄 910: | 줄 909: | ||
| </ | </ | ||
| </ | </ | ||
| - | ====align-content: | + | ===== Example ===== |
| '' | '' | ||
| + | {{: | ||
| + | |||
| <code css> | <code css> | ||
| - | .flex-container { | + | < |
| - | display: flex; | + | |
| - | height: 600px; | + | display: flex; |
| - | flex-wrap: wrap; | + | height: 600px; |
| - | align-content: | + | flex-wrap: wrap; |
| - | } | + | align-content: |
| + | | ||
| + | | ||
| + | |||
| + | .flex-container > div { | ||
| + | background-color: | ||
| + | width: 100px; | ||
| + | margin: 10px; | ||
| + | text-align: center; | ||
| + | line-height: | ||
| + | font-size: 30px; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | in the middle of the container:</ | ||
| + | |||
| + | <div class=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| </ | </ | ||
| - | \\ | + | ===== Example ===== |
| - | ====align-content: | + | |
| '' | '' | ||
| + | {{: | ||
| <code css> | <code css> | ||
| - | .flex-container { | + | < |
| - | display: flex; | + | |
| - | height: 600px; | + | display: flex; |
| - | flex-wrap: wrap; | + | height: 600px; |
| - | align-content: | + | flex-wrap: wrap; |
| - | } | + | align-content: |
| + | | ||
| + | | ||
| + | |||
| + | .flex-container > div { | ||
| + | background-color: | ||
| + | width: 100px; | ||
| + | margin: 10px; | ||
| + | text-align: center; | ||
| + | line-height: | ||
| + | font-size: 30px; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | at the start of the container.</ | ||
| + | |||
| + | <div class=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| </ | </ | ||
| - | \\ | + | ===== Example ===== |
| - | ====align-content: | + | '' |
| - | '' | + | {{: |
| <code css> | <code css> | ||
| - | .flex-container { | + | < |
| - | display: flex; | + | |
| - | height: 600px; | + | display: flex; |
| - | flex-wrap: wrap; | + | height: 600px; |
| - | align-content: | + | flex-wrap: wrap; |
| - | } | + | align-content: |
| + | | ||
| + | | ||
| + | |||
| + | .flex-container > div { | ||
| + | background-color: | ||
| + | width: 100px; | ||
| + | margin: 10px; | ||
| + | text-align: center; | ||
| + | line-height: | ||
| + | font-size: 30px; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | at the end of the container.</ | ||
| + | |||
| + | <div class=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| </ | </ | ||
| - | \\ | + | =====Perfect Centering===== |
| - | ====Perfect Centering==== | + | |
| 하기의 예제들에서 아주 일반적인 스타일 문제인 완벽한 중앙 정렬 방안을 확인하겠습니다.\\ | 하기의 예제들에서 아주 일반적인 스타일 문제인 완벽한 중앙 정렬 방안을 확인하겠습니다.\\ | ||
| - | **SOLUTION:** 두 개의 '' | + | {{:wiki:css:css_note:perfect-centering.png? |
| - | < | + | |
| - | .flex-container { | + | |
| - | display: flex; | + | |
| - | height: 300px; | + | |
| - | justify-content: center; | + | |
| - | align-items: | + | |
| - | } | + | |
| - | </ | + | |
| \\ | \\ | ||
| - | =====All CSS Flexbox Container Properties===== | + | **SOLUTION: |
| + | <code css> | ||
| + | < | ||
| + | .flex-container { | ||
| + | display: flex; | ||
| + | justify-content: | ||
| + | align-items: | ||
| + | height: 300px; | ||
| + | background-color: | ||
| + | } | ||
| + | |||
| + | .flex-container > div { | ||
| + | background-color: | ||
| + | color: white; | ||
| + | width: 100px; | ||
| + | height: 100px; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | <p>A container with both the justify-content and the align-items properties | ||
| + | set to < | ||
| + | |||
| + | <div class=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ======All CSS Flexbox Container Properties====== | ||
| ^ Property | ^ Property | ||
| | align-center | | align-center | ||
| | align-items | | align-items | ||
| - | | display | + | | display |
| | flex-direction | | flex-direction | ||
| | flex-flow | | flex-flow | ||