13강 flexbox 1편 정의 및 사용 방법

yoonuooh·2023년 4월 12일
0

CSS

목록 보기
13/19
post-thumbnail

flexbox 1편 정의 및 사용 방법

flexbox

  • 박스 내 요소 간 공간 배분과 정렬 기능을 제공하는 1차원 레이아웃 모델
    - 주축 : 정방향
    - 교차축 : 역방향 (주축과 직교)
    - flex 컨테이너를 만들기 위해 컨테이너에 display: flex; 적용
  • flex-direction : 주축 및 진행 방향 설정
속성값주축콘텐츠 방향
row (기본)동일
row-reverse반대
column동일
column-reverse반대

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>flexbox</title>
        <style>
            .container{
                display: flex;
                flex-direction: column-reverse;
            }
            .item{
                width: 80px; height: 80px;
                background-color: orange;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <div class="item">1</div>
            <div class="item">2</div>
            <div class="item">3</div>
        </div>
    </body>
</html>

출처 : 유노코딩, 입문자를 위한 CSS 기초 강의

profile
ISTJ의 재미없는 velog

0개의 댓글