소프트웨어 이론교육/웹 퍼블리싱

반응형 HTML (시맨틱 태그)

마루설아 2022. 7. 26. 19:23
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="user-scalable=no, maxinum-scale=1, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 3px;
            padding: 3px;
            border: 1px solid gray;
            border-radius: 6px;
            box-sizing: border-box;
        }

        body, div.contents{
            background-color: pink;
            margin: 0; 
            padding: 0;
            border: 0px;
            border-radius: 0;
        }

        section, aside {
            float: left;
            height: 400px;
            background-color: white;
        }
        footer {
            clear: both;
            background-color: white;    
        }
        aside {
            width: 20%;
        }
        section {
            width: 52%;
        }

        section>p {
            height: 200px;
        }

        /* 스마트폰에서 보기 편한 형태로 반응형 적용.*/
        @media screen and (max-width:767px) {
            body {
                background-color: skyblue;
            }

            aside{
                width: auto;
                float: none;
            }

            section{
                width: auto;
                float: none;
            }
        }
    </style>
</head>
<body>
    <div class="contents">
        <header>header</header>
        <nav>menu</nav>
        <aside>left side</aside>
        <section>
            <p>main</p>
            <article>내용1</article>
            <article>내용2</article>
            <article>내용3</article>
        </section>
        <aside>right side</aside>
        <footer>
            (c) 반응형 테스트
        </footer>
    </div>
</body>
</html>

'소프트웨어 이론교육 > 웹 퍼블리싱' 카테고리의 다른 글

이미지 로테이트  (0) 2022.07.27
아날로그 시계 구현하기  (0) 2022.07.27
반응형 HTML (2)  (0) 2022.07.26
반응형 HTML  (0) 2022.07.26
이미지 넘기기  (0) 2022.07.26