๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
WebSite

์›น์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ : ํ—ค๋” ์œ ํ˜• ๋ ˆ์ด์•„์›ƒ01

by ์ฝ”ํŒŒ์นด 2022. 9. 1.
728x90

 

๋ ˆ์ด์•„์›ƒ : ํ—ค๋” ์œ ํ˜•01

๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ—ค๋” ์œ ํ˜•์˜ ๋ ˆ์ด์•„์›ƒ์„ ์ž‘์—…ํ•ด ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

HTML ์†Œ์Šค

ํ—ค๋” ์œ ํ˜•์€ header__wrap ์•ˆ์— header__inner ๋ฐ•์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ๊ณ , logo, menu, member์˜ ์„ธ ๋ถ€๋ถ„์œผ๋กœ ๋‚˜๋ˆ„์–ด ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. logo์—๋Š” ์›น์‚ฌ์ดํŠธ์˜ ์ œ๋ชฉ(๋กœ๊ณ ), menu์—๋Š” ๋‹ค์„ฏ ๊ฐ€์ง€์˜ ๋ฉ”๋‰ด, member์—๋Š” ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ์„ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

<section id="headerType" class="header__wrap nexon">
    <div class="header__inner">
        <div class="header__logo">
            <a href="#">web <em>site</em></a>
        </div>
        <nav class="header__menu">
            <ul>
                <li><a href="#">ํ—ค๋” ์˜์—ญ</a></li>
                <li><a href="#">์Šฌ๋ผ์ด๋“œ ์˜์—ญ</a></li>
                <li><a href="#">๋ฐฐ๋„ˆ ์˜์—ญ</a></li>
                <li><a href="#">์ฝ˜ํ…์ธ  ์˜์—ญ</a></li>
                <li><a href="#">ํ‘ธํ„ฐ ์˜์—ญ</a></li>
            </ul>
        </nav>
        <div class="header__member">
            <a href="#">๋กœ๊ทธ์ธ</a>
        </div>
    </div>
</section>

CSS ์†Œ์Šค

๊ฐ๊ฐ์˜ ์œ„์น˜๋Š” flex, space-between ์†์„ฑ์„ ์ด์šฉํ•ด ์„ค์ •ํ•ด ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ฐ๊ฐ์˜ ๋ฉ”๋‰ด ๋ฒ„ํŠผ, ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ์—๋Š” ๋งˆ์šฐ์Šค๋ฅผ ๋Œ€๋ฉด background ์ƒ‰์ƒ์ด ์ ์ฐจ์ ์œผ๋กœ ๋ณ€ํ™”ํ•˜๋Š” hover ํšจ๊ณผ๋ฅผ ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

/* headerType */
.header__inner {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
}
.header__logo {
    width: 20%;
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
}
.header__logo em {
    font-size: 18px;
    font-weight: 400;
}
.header__menu {
    width: 60%;
    text-align: center;
}
.header__menu li {
    display: inline;
}
.header__menu li a {
    padding: 13px 30px;
    margin: 0 5px;
    transition: background-color 0.3s;
}
.header__menu li a:hover {
    background-color: #f1f1f1;
    border-radius: 5px;
}
.header__member {
    width: 20%;
    text-align: right;
}
.header__member a {
    font-size: 16px;
    border: 1px solid #000;
    padding: 10px 30px;
    border-radius: 50px;
    transition: all 0.3s;
}
.header__member a:hover {
    background-color: #000;
    color: #fff;
}

๊ฒฐ๊ณผ

728x90

๋Œ“๊ธ€

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๐Ÿฆ™

CSS
๊ด‘๊ณ  ์ค€๋น„์ค‘