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

์›น์‚ฌ์ดํŠธ - ์นด๋“œ ์œ ํ˜•01

by _ํ† ๋งคํ†  2022. 8. 10.
728x90

 

CardType01

์›นํŽ˜์ด์ง€ ์‹ค์Šต์„ ์œ„ํ•œ ์นด๋“œํƒ€์ž… ํŽ˜์ด์ง€ ๊ธฐ์ดˆ ์‹ค์Šตํ•˜๊ธฐ!


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

ํ”ผ๊ทธ๋งˆ๋ฅผ ํ†ตํ•ด ์›ํ•˜๋Š” ์นด๋“œ ์œ ํ˜•์„ ๋””์ž์ธ ํ•ฉ๋‹ˆ๋‹ค. ๋””์ž์ธ์„ ํ•  ๋• ๋งŒ๋“ค๊ณ ์ž ํ•˜๋Š” ํŽ˜์ด์ง€์˜ ์„ฑ๊ฒฉ์„ ์ž˜ ํŒŒ์•…ํ•˜์—ฌ ๊ทธ๋ฆฌ๋“œ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๋“œ ์ž‘์—…์ด ์™„๋ฒฝํ•ด์•ผ ํ›„์— ์ฝ”๋”ฉ์„ ํ•˜๋Š” ๋ฐ ์žˆ์–ด์„œ๋„ ์˜ค๋ฅ˜ ๋ฐ ์˜ค์ฐจ๊ฐ€ ์ƒ๊ธฐ์ง€ ์•Š์•„ ๋ถˆํŽธํ•ด์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค!


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

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

๊ตฌ์กฐ ํŒŒ์•…ํ•˜๊ธฐ
1. ์นด๋“œ ๋ ˆ์ด์•„์›ƒ์€ ๋ณดํ†ต ์›น ๋ฉ”์ธ ํŽ˜์ด์ง€์˜ ์„น์…˜ ๋ถ€๋ถ„์— ์œ„์น˜ํ•œ๋‹ค. ๋•Œ๋ฌธ์— ์‹œ๋ฉ˜ํ‹ฑ ํƒœ๊ทธ์ธ <section>์„ ์‚ฌ์šฉํ•ด์ฃผ์–ด ์นด๋“œ ์˜์—ญ์— ํ•ด๋‹นํ•˜๋Š” ๋ชจ๋“  ์š”์†Œ๋ฅผ ๋ฌถ์–ด์ค€๋‹ค.
2. ์นด๋“œ์˜์—ญ์€ ์ด 3๊ฐœ์ด๊ธฐ ๋•Œ๋ฌธ์— 3๊ฐœ์˜ <article>์„ ์‚ฌ์šฉํ•ด์ฃผ์–ด ๋ฌถ์–ด์ค€๋‹ค.
3. article์˜ ํ—ค๋” ๋ถ€๋ถ„์—๋Š” <figure>๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€๋ฅผ ์‚ฝ์ž…ํ•ด์ค€๋‹ค. ๋งˆ์นœ๊ฐ€์ง€๋กœ ๋ฐ”๋”” ๋ถ€๋ถ„์—๋Š” ํ•ด๋‹นํ•˜๋Š” ํ…์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๋ฉด ๋œ๋‹ค.
4. ์›น ์ ‘๊ทผ์„ฑ์— ๋งž์ถฐ btn์„ ๋‚˜ํƒ€๋‚ด๋Š” span ํƒœ๊ทธ์—๊ฒŒ aria-hidden="true"๋ผ๋Š” ์†์„ฑ์„ ์ฃผ์–ด ์Šคํฌ๋ฆฐ๋ฆฌ๋” ํ”„๋กœ๊ทธ๋žจ์ด ๋‚ด์šฉ๊ณผ ๊ด€๋ จ์ด ์—†๋Š” svgํŒŒ์ผ์„ ์ฝ์ง€ ์•Š๊ณ  ์ง€๋‚˜๊ฐ€๋„๋ก ํ•ด์ค€๋‹ค.

<section id="cardType" class="card__wrap nexon section">
<h2>์ „์‹œํšŒ ๋ฆฌ์ŠคํŠธ</h2>
<p>์ „์‹œ๋ฅผ ์ข‹์•„ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์„ ์œ„ํ•œ ์ „์‹œ ๋ฆฌ์ŠคํŠธ</p>
<div class="card__inner container">
    <article class="card">
        <figure class="card__header">
            <img src="img/card_bg01.jpg" alt="์ƒ์—… ์ „์‹œ">
        </figure>
        <div class="card__body">
            <h3 class="tit">์ƒ์—… ์ „์‹œ๋ฅผ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”?</h3>
            <p class="desc">
                ์ƒ์—…์ ์ธ ์„ฑ๊ฒฉ์„ ๋„๋Š” ์ „์‹œํšŒ๋กœ ๋Œ€ํ‘œ์ ์œผ๋กœ๋Š” ๋””์ž์ธ์•„ํŠธํŽ˜์–ด, ํ‚ค์•„ํ”„ ๋“ฑ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์ „์‹œํšŒ์—์„œ๋Š” ๊ด€๋žŒ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ํ˜„์žฅ์—์„œ ๋ฐ”๋กœ ๊ตฌ๋งคํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
            </p>
            <a class="btn" href="#">
                ๋” ์ž์„ธํžˆ ๋ณด๊ธฐ
                <span aria-hidden="true"> 
                    <svg width="65" height="8" viewBox="0 0 65 8" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M64.3536 4.35355C64.5488 4.15829 64.5488 3.84171 64.3536 3.64645L61.1716 0.464466C60.9763 0.269204 60.6597 0.269204 60.4645 0.464466C60.2692 0.659728 60.2692 0.976311 60.4645 1.17157L63.2929 4L60.4645 6.82843C60.2692 7.02369 60.2692 7.34027 60.4645 7.53553C60.6597 7.7308 60.9763 7.7308 61.1716 7.53553L64.3536 4.35355ZM0 4.5H64V3.5H0V4.5Z" fill="black"/>
                        </svg>                                
                </span>
            </a>
        </div>
    </article>
    <article class="card">
        <figure class="card__header">
            <img src="img/card_bg02.jpg" alt="๋ฏธ์ˆ  ์ „์‹œ">
        </figure>
        <div class="card__body">
            <h3 class="tit">๋ฏธ์ˆ  ์ „์‹œ๋ฅผ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”?</h3>
            <p class="desc">
                ์ˆœ์ˆ˜๋ฏธ์ˆ ๊ณผ ๊ฐ™์€ ์˜ˆ์ˆ  ๋ถ„์•ผ๋ฅผ ์ฃผ๋กœ ์ „์‹œํ•˜๋ฉฐ ๊ฐ€๋ฒผ์šด ์ƒ์—… ์ „์‹œ์™€๋Š” ๋‹ฌ๋ฆฌ ์ข€๋” ๊นŠ์€ ๋ฌธํ™” ์˜ˆ์ˆ ์„ ๊ด€๋žŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ „๋ฌธ์ ์ธ๊ธฐ๊ด€์—์„œ ์šด์˜ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋Œ€๋ถ€๋ถ„ ์ž…๋‹ˆ๋‹ค.
            </p>
            <a class="btn" href="#">
                ๋” ์ž์„ธํžˆ ๋ณด๊ธฐ
                <span aria-hidden="true"> 
                    <svg width="65" height="8" viewBox="0 0 65 8" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M64.3536 4.35355C64.5488 4.15829 64.5488 3.84171 64.3536 3.64645L61.1716 0.464466C60.9763 0.269204 60.6597 0.269204 60.4645 0.464466C60.2692 0.659728 60.2692 0.976311 60.4645 1.17157L63.2929 4L60.4645 6.82843C60.2692 7.02369 60.2692 7.34027 60.4645 7.53553C60.6597 7.7308 60.9763 7.7308 61.1716 7.53553L64.3536 4.35355ZM0 4.5H64V3.5H0V4.5Z" fill="black"/>
                        </svg>                                
                </span>
            </a>
        </div>  
    </article>
    <article class="card">
        <figure class="card__header">
            <img src="img/card_bg03.jpg" alt="์‚ฌ์ง„ ์ „์‹œ">
        </figure>
        <div class="card__body">
            <h3 class="tit">์‚ฌ์ง„ ์ „์‹œ๋ฅผ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”?</h3>
            <p class="desc">
                ์‚ฌ์ง„์„ ์ฃผ์ œ๋กœ ํ•˜์—ฌ ์ผ์ƒ์˜ ๋ชจ์Šต ๋˜๋Š” ๊ทธ ์ด์ƒ์„ ๋ณด์—ฌ์ฃผ๋Š” ์ž‘ํ’ˆ๋“ค์„ ๊ฐ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ ์‚ฌ์ง„์ „์˜ ์ˆ˜์š”๊ฐ€ ์˜ค๋ฅด๋Š” ์ถ”์„ธ์ด๋ฉฐ, ๊ฐ€๋ณ๊ฒŒ ๊ด€๋žŒํ•˜๊ธฐ์—๋„ ์ข‹์Šต๋‹ˆ๋‹ค. 
            </p>
            <a class="btn" href="#">
            ๋” ์ž์„ธํžˆ ๋ณด๊ธฐ
            <span aria-hidden="true"> 
                <svg width="65" height="8" viewBox="0 0 65 8" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M64.3536 4.35355C64.5488 4.15829 64.5488 3.84171 64.3536 3.64645L61.1716 0.464466C60.9763 0.269204 60.6597 0.269204 60.4645 0.464466C60.2692 0.659728 60.2692 0.976311 60.4645 1.17157L63.2929 4L60.4645 6.82843C60.2692 7.02369 60.2692 7.34027 60.4645 7.53553C60.6597 7.7308 60.9763 7.7308 61.1716 7.53553L64.3536 4.35355ZM0 4.5H64V3.5H0V4.5Z" fill="black"/>
                    </svg>                                
            </span>
        </a>
        </div>
    </article>
</div>
</section>

< CSS ์†Œ์Šค >

๊ตฌ์กฐ ์งœ์ž„์˜ ์ˆœ์„œ๋Œ€๋กœ css ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œ์ผœ๋ณด์ž. css ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œํ‚ฌ ๋• ์„ ํƒ์ž์˜ ์œ„์น˜์™€ ๊ด€๊ณ„๋ฅผ ์ฃผ์˜ํ•ด์„œ ์„ ์–ธํ•ด์•ผ ํ•œ๋‹ค!

/* fonts */
@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;
}

/* common */
.container {                /* ๋ถ€๋ชจ ์ปจํ…Œ์ด๋„ˆ ๋ฐ•์Šค๋ฅผ ๋งŒ๋“ค์–ด ๊ฐ€๋กœ ๊ฐ’์„ ๊ณ ์ •์‹œํ‚จ๋‹ค. */
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
}
.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;
}

/* cardType */
.card__inner {
    display: flex;
    justify-content: space-around; /* ์ค‘์‹ฌ์„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌํ•˜์—ฌ ๋ชจ์•„์ค€๋‹ค.*/
}
.card {
    width: 32%;
    background: #f5f5f5;
}
.card__body {
    padding: 24px;
}
.card__body .tit {
    font-size: 24px;
    margin-bottom: 10px;
}
.card__body .desc {
    font-size: 18px;
    line-height: 1.4;
    color: #666;
    margin-bottom: 20px;
    font-weight: 300;
}
.card__body .btn {}

!์˜ค๋Š˜์˜ ํฌ์ธํŠธ!

figure ํƒœ๊ทธ
์ด๋ฏธ์ง€ ๋˜๋Š” ๊ทธ๋ž˜ํ”„ ๋“ฑ์˜ ๋„ํ‘œ ์ž๋ฃŒ๋“ค์„ ์˜๋ฏธํ•˜๋Š” ์‹œ๋ฉ˜ํ‹ฑ ํƒœ๊ทธ์ด๋‹ค.
๋•Œ๋ฌธ์— img์™€ ๊ฐ™์€ ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ์—๋Š” ๊ผญ ํ•จ๊ผ ์‚ฌ์šฉํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

<figure></figure>

<!-- ์˜ˆ์‹œ -->
<figure>
    <img src="" alt="">
</figure>

aria-hidden="true" ์†์„ฑ
์›น ์ ‘๊ทผ์„ฑ์„ ์œ„ํ•ด ์Šคํฌ๋ฆฐ๋ฆฌ๋” ํ”„๋กœ๊ทธ๋žจ์ด ๋‚ด์šฉ๊ณผ ๊ด€๋ จ์ด ์—†๋Š” ํŒŒ์ผ์„ ์ฝ์ง€ ์•Š๊ณ  ์ง€๋‚˜๊ฐ€๋„๋ก ํ•ด์ค€๋‹ค.

<span aria-hidden="true">
    <svg>svg์†Œ์Šค</svg>
</span>

css์†์„ฑ ์„ ํƒ์ž(์š”์†Œ)์˜ ์šฐ์„ ์ˆœ์œ„
์œ„์น˜๋ฅผ ๋” ์ž์„ธํžˆ ์„ ์–ธํ•ด์ค„ ์ˆ˜๋ก ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋†’์•„์ง„๋‹ค. ๋˜ํ•œ ์˜ค๋ฅ˜์˜ ๊ฐ€๋Šฅ์„ฑ๋„ ๋‚ฎ์•„์ง€๊ธฐ ๋•Œ๋ฌธ์— ๊ตฌ์กฐ๊ฐ€ ๋ณต์žกํ•  ์ˆ˜ ๋ก ์œ„์น˜์™€ ์„ ํƒ์ž ๋ช…์นญ์„ ์ค‘์š”ํ•˜๊ฒŒ ์„ ์–ธํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

.card .card__body .btn {} //1
.card__body .btn {} //2

css์†์„ฑ ์„ ํƒ์ž(์š”์†Œ)๊ฐ„์˜ ๊ด€๊ณ„
์š”์†Œ > ์š”์†Œ๋Š” ๋ถ€๋ชจ์™€ ์ž์‹์˜ ๊ด€๊ณ„๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค. ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์š”์†Œ + ์š”์†Œ๋Š” ํ˜•์ œ ๊ด€๊ณ„๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค.

.section > h2 /*section์•ˆ์— h2๋ผ๋Š” ์ž์‹์š”์†Œ๋ฅผ ์˜๋ฏธ*/
.section > h2 + p /*section์•ˆ์— ์ž์‹์š”์†Œ์™€ h2์™€ h2์˜ ํ˜•์ œ ์š”์†Œ์ธ p๋ฅผ ์˜๋ฏธ*/

๊ฒฐ๊ณผ๋ณด๊ธฐ

728x90

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css