<body>
    <div id="wrap">
        <div id="header"></div>
        <div id="nav"></div>
        <div id="main">
            <div id="aside"></div>
            <div id="article1"></div>
            <div id="article2">
                <div id="article2-1"></div>
                <div id="article2-2"></div>
            </div>
        </div>
        <div id="footer"></div>
    </div>
</body>
<style>
        *{
            margin:0;
            padding:0;
            /* overflow: hidden; 푸터를 만드는 두번째 방법*/
        }
        body{
            background-color: #e1f5fe;
        }
        #wrap{
            width: 1200px;
            margin: 0 auto;
        }
        #header{
            height: 100px;
            background-color: #b3e5fc;
        }
        #nav{
            height: 100px;
            background-color: #81d4fa;
        }
        #main{
            display: flex;
            flex-wrap: wrap;
            flex-direction: column;
            height: 780px; /*높이가 고정되어 있으니까 거기에 맞춰서 flex가 작동하고 레이아웃이 column으로 잡힘 */
        }
        #aside{
            width: 30%;
            height: 780px;
            background-color: #4fc3f7;
        }
        #article1{
            width: 70%;
            height: 260px;
            background-color: #29b6f6;
        }
        #article2-1{
            width: 100%;
            height: 260px;
            background-color: #03a9f4;
        }
        #article2-2{
            width: 100%;
            height: 260px;
            background-color: #039be5;
        }
        #footer{
            height: 100px;
            background-color: #0288d1;
            /* clear: both; 푸터를 만드는 첫번째 방법*/
        }

        /* 미디어 쿼리 */
        @media(max-width: 1300px){
            #wrap{
                width: 96%;
            }
            #article2{
                display: flex;
            }
            #article2-1{
                width: 50%;
                height: 520px;
            }
            #article2-2{
                width: 50%;
                height: 520px;
            }
        }
        @media(max-width: 768px){
            #wrap{
                width: 100%;
            }
            #article1{
                width: 100%;
                height: 390px;
            }
            #article2-1{
                width: 100%;
                height: 390px;
            }
            #article2-2{
                display: none;
            }
        }
        @media(max-width: 480px){
            #aside{
                width: 100%;
                height: 200px;
            }
            #article1{
                height: 430px;
            }
            #article2-1{
                height: 150px;
            }
        }
    </style>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.