본문 바로가기
728x90

Flex4

[ flex ] justify-content justifiy-content 자식요소 정렬에 대한 속성이다 html 자식요소 justifiy-content : center; 자식요소 가운데 정렬 .parent{ display: flex; border: 5px solid #000; justify-content: center; } .child{ background-color: rgb(57, 246, 130); width: 200px; height: 200px; color: #fff; text-align: center; line-height: 200px; } justify-content:flex-start; 자식요소 왼쪽 정렬 .parent{ display: flex; border: 5px solid #000; justify-content: flex-st.. 2022. 12. 30.
[ flex ] display:flex; display:flex; 자식요소를 이렇게 배열할 수 있다 display:inline-flex도 마찬가지인데, inline-flex는 자식요소의 영역만큼 부모요소의 너비가 정해진다 html 자식요소 자식요소 자식요소 css .parent{ display: flex; } .child{ background-color: yellowgreen; width: 200px; height: 200px; margin: 10px; color: #fff; text-align: center; line-height: 200px; } 2022. 12. 30.
[ flex ] 부모 요소 / 자식 요소에 사용하는 flex 부모요소 display : flex 사용 (flex | inline-flex) flex-direction : 자식요소 수평 정렬 ( row | column ) flex-wrap : 자식요소 수직 정렬 ( nowrap | wrap-reverse ) justify-content : 자식요소 배치 방향 ( flex-start | flex-end | center | space-between | space-arount ) align-items : 너비를 줄이기, 줄바꿈 ( flex-start | flex-end | center | baseline | stretch ) align-content : 자식요소 여러 줄 일때 ( flex-start | flext-end | center | space-between | s.. 2022. 12. 30.
[ flex ] 요소 정중앙에 배치하기 결과 화면 css body{ display: flex; justify-content: center; align-items: center; height: 100vh; } .box{ background-color: cadetblue; color: #fff; width: 200px; height: 200px; text-align: center; line-height: 200px; font-size: 2em; } html box 2022. 12. 30.
728x90
반응형