초짜코딩의 잡동사니

layout - 6 (flaot) 본문

Layout/반응형

layout - 6 (flaot)

초짜코딩 2022. 4. 17. 18:28
    <style>
         * {
            margin: 0;
        }
        body {
            background-color: #FFF3E0;
        }
        #wrap {
            width: 1200px;
            margin: 0 auto;
        }
        #header {
            width: 100%;
            height: 100px;
            background-color: #FFE0B2;
        }
        #nav {
            width: 100%;
            height: 100px;
            background-color: #FFCC80;
        }
        #aside {
            width: 30%;
            height: 780px;
            float: left;
            background-color: #FFB74D;
        }
        #contents {
            width: 70%;
            height: 780px;
            float: left;
            background-color: #FFA726;
        }
        #footer {
            width: 100%;
            height: 100px;
            clear: both;
            background-color: #FF9800;
        }

        @media (max-width:1300px){
            #wrap {
                width: 96%;
            }
        }
        @media (max-width:768px){
            #wrap {
                width: 100%;
            }
        }
        @media (max-width:480px){
            #aside {
                width: 100%;
                height: 300px;
            }
            #contents {
                width: 100%;
                height: 480px;
            }
        }
    </style>​
    <div id="wrap">
        <div id="header"></div>
        <div id="nav"></div>
        <div id="aside"></div>
        <div id="contents"></div>
        <div id="footer"></div>
    </div>

'Layout > 반응형' 카테고리의 다른 글

layout - 7 (grid)  (0) 2022.04.17
layout - 7 (float)  (0) 2022.04.17
layout -7 (flex)  (0) 2022.04.17
layout - 6 (grid)  (0) 2022.04.17
layout - 6 (flex)  (0) 2022.04.17