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

[SITE] ์›น์‚ฌ์ดํŠธ - ํ—ค๋” ์œ ํ˜•01

by _ํ† ๋งคํ†  2022. 9. 2.
728x90

HeaderType01

์›นํŽ˜์ด์ง€ ์‹ค์Šต์„ ์œ„ํ•œ ํ—ค๋” ํƒ€์ž… ์œ ํ˜•์„ ์‹ค์Šตํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค! ํ—ค๋” ํƒ€์ž…์€ ๋ณดํ†ต ๊ฐ€์žฅ ์œ„์— ์œ„์น˜ํ•˜๋ฉฐ ๋กœ๊ณ ์™€ ๋ฉ”๋‰ด ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ ๋“ฑ์˜ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค!!
๊ทธ๋Ÿผ ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉฐ ํ•จ๊ป˜ ์‹ค์Šต ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค~๐Ÿ˜†


< figma : ๋””์ž์ธ ํ•˜๊ธฐ >

์ด๋ฒˆ ์œ ํ˜•์€ ํ—ค๋” ์œ ํ˜•์ด๊ธฐ ๋•Œ๋ฌธ์— ํฌ๊ธฐ์— ๋งž๊ฒŒ ํ”„๋ ˆ์ž„์„ ์กฐ์ •ํ•˜์—ฌ ๋งž์ถฐ์ค๋‹ˆ๋‹ค. ๋ฉ”๋‰ด๋Š” ๊ผญ ๋ฉ”์ธ ์˜์—ญ์— ์œ„์น˜ํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค! ํŠนํžˆ ๊ธ€์ž ๊ฐ„ ๊ฐ„๊ฒฉ๊ณผ ์ •๋ ฌ์„ ์ž˜ ์ง€์ผœ์ค์‹œ๋‹ค!

์•„๋ž˜์˜ ํ”ผ๊ทธ๋งˆ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ HTML, CSS๋ฅผ ์„ค์ •ํ•ด๋ด…์‹œ๋‹ค. ๐Ÿ˜‡


< HTML ์†Œ์Šค : ๋ ˆ์•„์•„์›ƒ ๊ตฌ์กฐ ํŒŒ์•…ํ•˜๊ธฐ >

๋””์ž์ธํ•œ ์›น ํŽ˜์ด์ง€ ์‹œ์•ˆ์„ ๋ณด๋ฉฐ ํŽ˜์ด์ง€ ๊ตฌ์กฐ๋ฅผ ํŒŒ์•…ํ•œ ํ›„ ์›น ํ‘œ์ค€์„ฑ๊ณผ ์ ‘๊ทผ์„ฑ์— ๋งž๋Š”์‹œ๋ฉ˜ํ‹ฑํ•œ ๋งˆํฌ์—…์„ ํ•ด์ค๋‹ˆ๋‹ค.

TIP !
โ€ข ํฐ ๋ฉ์–ด๋ฆฌ๋ถ€ํ„ฐ ์ฐจ๊ทผ์ฐจ๊ทผ ๊ตฌ์กฐ๋ฅผ ์งœ๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
โ€ข ํ—ค๋”์œ ํ˜•์— ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” nav๋Š” ๋ณดํ†ต ํŽ˜์ด์ง€์— 1๊ฐœ ์ด์ƒ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค!

<section id="headerType01" 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__memder">
            <a href="#">๋กœ๊ทธ์ธ</a>
        </div>
    </div>
</section>

< CSS ์†Œ์Šค : ์Šคํƒ€์ผ ์ ์šฉํ•˜๊ธฐ >

๊ตฌ์กฐ ์งœ์ž„์˜ ์ˆœ์„œ๋Œ€๋กœ css ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œ์ผœ ๋ด…์‹œ๋‹ค. ์ด ๋•Œ ๋””์ž์ธ ์‹œ์•ˆ์„ ์ฐธ๊ณ ํ•˜๋ฉด์„œ html์™€ ๋ฒˆ๊ฐˆ์•„๊ฐ€๋ฉฐ ํฐ ๋ฉ์–ด๋ฆฌ ๋ถ€ํ„ฐ ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œ์ผœ ๋‚˜๊ฐ€๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
์†์„ฑ์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ์ฝ”๋“œ์™€ ์ฃผ์„์„ ๋ณด๋ฉด์„œ ์ดํ•ดํ•ด๋ด…์‹œ๋‹ค!

TIP !
โ€ข ๋จผ์ € ์ „์ฒด ์ดˆ๊ธฐํ™”(Reset)์™€ ํฐํŠธ ๋””ํดํŠธ ์„ค์ •์„ ํ•ด์ฃผ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
โ€ข ๊ฐ ์˜์—ญ๊ณผ ์„น์…˜์— ๋ฐ˜๋ณต์ ์œผ๋กœ ๋“ค์–ด๊ฐ€๋Š” ์†์„ฑ๋“ค์€ ๊ณตํ†ต ์†์„ฑ์œผ๋กœ ๋”ฐ๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
โ€ข ์ปจํ…Œ์ด๋„ˆ ์„ค์ •์„ ํ†ตํ•ด ๋ฉ”์ธ ํ™”๋ฉด ํฌ๊ธฐ์™€ ์—ฌ๋ฐฑ์„ ์„ค์ •ํ•ด์ค€ ๋’ค ๋ฉ”์ธ ์ฝ˜ํ…์ธ ์ธ ์„น์…˜์—๊ฒŒ ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œํ‚ต๋‹ˆ๋‹ค.
โ€ข inner์˜์—ญ์— position: fixed๋ฅผ ์ฃผ์–ด์„œ ์Šคํฌ๋กค์„ ๋‚ด๋ ค๋„ ํ—ค๋”(๋ฉ”๋‰ด๋ฐ”)๊ฐ€ ๋ณด์ด๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

/* font */
@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');

.nexon {
    font-family: 'NexonLv1Gothic';
    font-weight: 400;
}

/* reset */
* {
    margin: 0;
    padding: 0;
}
a {
    text-decoration: none;
    color: #000;
}
img {
    width: 100%;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}
em, i, address {
    font-style: normal;
}

/* common : ๊ณตํ†ต ์š”์†Œ(์žฌํ™œ์šฉ) */
.container {
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
    min-width: 1160px;
}
.section {
    padding: 120px 0;
}
.section > h2 {
    font-size: 50px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
}
.section > p {
    font-size: 22px;
    font-weight: 300;
    color: #666;
    text-align: center;
    margin-bottom: 70px;
}

/* headerType */
.header__inner {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    position: fixed;/* ํ—ค๋”ํƒ€์ž…์ด๋ฏ€๋กœ ์œ„์— ๊ณ ์ •ํ•˜์—ฌ ์Šคํฌ๋กค์„ ๋‚ด๋ ค๋„ ๋ณด์ด๋„๋ก ํ•œ๋‹ค. */
    left: 0;
    top: 0;
    background-color: #fff;
}
.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 */
.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

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css