Christmas Pikachu flex, nav, ul, article, footer 활용하기
개발일지/HTML

flex, nav, ul, article, footer 활용하기

ZI_CO 2022. 11. 9.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            font-family: Arial, Helvetica, sans-serif;
        }

        header {
            background-color: #666;
            padding: 30px;
            text-align: center;
            font-size: 35px;
            color: white;
        }

        section {
            display: flex;

        }

        nav {
            background-color: #ccc;
            padding: 20px;
            flex: 1;
        }

        nav ul {
            list-style: none;
            padding: 0px;
        }

        article {
            flex: 3;
            background-color: #f1f1f1;
            padding: 10px;
        }

        footer {
            background-color: #777;
            padding: 10px;
            text-align: center;
            color: white;
        }

        @media (max-width : 600px) {
            section {
                flex-direction: column;
            }
        }

     

    </style>        
</head>
<body>
    <header>
        <h2>Cities</h2>
    </header>
    <section>
        <nav>
            <ul>
                <li><a href="#">London</a></li>
                <li><a href="#">Paris</a></li>
                <li><a href="#">Korea</a></li>
            </ul>
        </nav>
        <article>
            <h1>London</h1>
            <p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
            <p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>
        </article>
    </section>
    <footer>
        <p>my company</p>
    </footer>
</body>
</html>

댓글