[CSS] flex 기본
<!DOCTYPE html>
<html>
    <head>
        <style>
            .container{
                background-color: powderblue;
                height: 100px;
                display: flex;
                flex-direction: row-reverse;
            }
            .item{
                background-color: tomato;
                color: white;
                border: 1px solid white;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <div class="item">1</div>
            <div class="item">2</div>
            <div class="item">3</div>
            <div class="item">4</div>
            <div class="item">5</div>
        </div>
    </body>
</html>
flex는 부모 자식이 있어야 적용이 된다.- 위 예제에서는
.container가 부모.item이 자식으로 되어있다.
.container{에display값이flex로 되어있어야 한다.- 정렬 방향을
flex-direction:을 통해 변경할 수 있으며, 기본 값으로row이다.
Author And Source
이 문제에 관하여([CSS] flex 기본), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@jong/CSS-flex-기본저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)