<div class="container">
<div class="item">helloflex</div>
<div class="item">abc</div>
<div class="item">helloflex</div>
</div>
.container {
display: flex;
/* display: inline-flex; */ //inline-flex는 inline-block처럼 동작
}
.container {
flex-direction: row;
/* flex-direction: column; */
/* flex-direction: row-reverse; */
/* flex-direction: column-reverse; */
}
.container {
flex-wrap: nowrap;
//디폴트, 요소가 삐져나올 수 있음
/* flex-wrap: wrap; */
//요소가 공간이 없으면 다음 줄로 넘어감
/* flex-wrap: wrap-reverse; */
//요소가 공간이 없으면 이전 줄로 넘어감
}
.container {
flex-flow: row wrap;
/* 아래의 두 줄을 줄여 쓴 것 */
/* flex-direction: row; */
/* flex-wrap: wrap; */
}
.container {
justify-content: flex-start;
//디폴트, 시작점으로 정렬
/* justify-content: flex-end; */
//끝점으로 정렬
/* justify-content: center; */
//가운데로 정렬
/* justify-content: space-between; */
/* justify-content: space-around; */
/* justify-content: space-evenly; */ 나머지는 플러터와 같다!
}
.container {
align-items: stretch; //디폴트, 수직축 방향으로 끝까지 늘어남.
/* align-items: flex-start; */
//시작점으로 정렬
/* align-items: flex-end; */
//끝으로 정렬
/* align-items: center; */
//가운데로 정렬
/* align-items: baseline; */
//텍스트 베이스라인 기준으로 정렬
}
.container {
flex-wrap: wrap;
align-content: stretch;
/* align-content: flex-start; */
/* align-content: flex-end; */
/* align-content: center; */
/* align-content: space-between; */
/* align-content: space-around; */
/* align-content: space-evenly; */
}
나머지 속성은 추후에 더 공부하고 포스팅 하겠다!
출처
https://studiomeal.com/archives/197
https://developer.mozilla.org/ko/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox