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

[์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ] ์นด๋“œ ์œ ํ˜• ์„น์…˜ ๋งŒ๋“ค๊ธฐ ์‹ฌํ™”ํŽธ

by ์ฝ”๋”ฉ๊ณต์ฑ… 2022. 8. 10.
๋ฐ˜์‘ํ˜•

์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ : ์นด๋“œ ์œ ํ˜• 03

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” Figma์—์„œ ๋งŒ๋“  ์นด๋“œ ์œ ํ˜• ์„น์…˜์„ HTML๊ณผ CSS ์ฝ”๋“œ๋กœ ์˜ฎ๊ธฐ๋Š” ์ž‘์—…์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
์ตœ๋Œ€ํ•œ ์›น ํ‘œ์ค€์„ ์ค€์ˆ˜ํ•˜๊ธฐ ์œ„ํ•ด ์‹œ๋งจํ‹ฑ ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์ด๋ฏธ์ง€ ์ถœ๋ ฅ ์‹œ figure ํƒœ๊ทธ๋กœ ๊ฐ์‹ธ๋ฉฐ, img ํƒœ๊ทธ์—์„œ alt(์„ค๋ช…)์นธ์— ๋ถ€์—ฐ ์„ค๋ช…์„ ๋„ฃ๋Š” ๋“ฑ์˜ ์ž‘์—…์„ ์žŠ์ง€ ๋ง๋„๋ก ํ•ฉ์‹œ๋‹ค!


Figma

๋จผ์ € ๋งŒ๋“ค๊ณ ์ž ํ•˜๋Š” ์›น ์‚ฌ์ดํŠธ์˜ ๋ชจ์–‘์„ Figma๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•˜์—ฌ ์•„๋ž˜์™€ ๊ฐ™์ด ๋งŒ๋“ค์–ด์ฃผ๋„๋ก ํ•˜์ž.
์ด๋ฒˆ์— ๋งŒ๋“ค ์›น ์‚ฌ์ดํŠธ์˜ ์œ ํ˜•์€ ์นด๋“œ ์œ ํ˜• ์„น์…˜ ์‹ฌํ™”ํŽธ์ด๋ฉฐ ์ง€๋‚œ ๋ฒˆ ์นด๋“œ ์œ ํ˜•์ด ์ง„๋ผ๋ฉด ์ˆœํ•œ๋ง›์ด๋ผ๋ฉด ์ด๋ฒˆ ํŽธ์€ ๋ถˆ๋‹ญ, ๋งˆ๋ผ๋ง›์ด๋‹ˆ ๊ฐ์˜คํ•˜์ž๐Ÿฅต.

HTML ์†Œ์Šค

์›น ํ‘œ์ค€ ์ค€์ˆ˜๋ฅผ ์œ„ํ•ด ์‹œ๋งจํ‹ฑ ํƒœ๊ทธ๋ฅผ ์ ๊ทน ์‚ฌ์šฉํ•˜๊ณ  img ํƒœ๊ทธ์—์„œ์˜ alt ๊ธฐ๋Šฅ๋„ ์ ๊ทน ํ™œ์šฉํ•  ๊ฒƒ.
์ž์„ธํ•œ ์„ค๋ช…์€ ์•„๋ž˜ ์˜ˆ์‹œ ์ฝ”๋“œ์˜ ์ฃผ์„์ฒ˜๋ฆฌ ๋‚ด์šฉ์„ ์ฐธ์กฐํ•  ๊ฒƒ.

<body>
    <section id="cardType03" class="card__wrap score section">
        <h2 class="blind">ํฌํŠธํด๋ฆฌ์˜ค ๊ตฌ๊ฒฝํ•˜๊ธฐ</h2> <!-- ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ์—๋Š” ์ฝํžˆ๊ฒŒ ํ•˜๋˜ ๊ฒ‰์œผ๋ก  ์•ˆ๋ณด์ด๊ฒŒ ํ•˜๋ ค๋ฉด blind ์ฒ˜๋ฆฌํ•˜๊ธฐ -->
        <div class="card__inner container">
            <article class="card">
                <figure class="card__header">
                    <img src="img/card3_bg01.jpg" alt="๊น€๋ฏผ์ฃผ์˜ ํฌํŠธํด๋ฆฌ์˜ค">
                    <figcaption># Editorial Design</figcaption>
                </figure>
                <div class="card__contents">
                    <h3>
                        ๊น€๋ฏผ์ฃผ์˜ ๊ฐ์„ฑ ๋„˜์น˜๋Š” ํฌํŠธํด๋ฆฌ์˜ค,<br>๊ฐ™์ด ๊ตฌ๊ฒฝํ•˜์‹ค๋ž˜์š”?
                    </h3>
                    <p>
                        ์ˆ˜ํ—˜์ƒ ์‹œ์ ˆ ๋ฐ›์•˜๋˜ ์ŠคํŠธ๋ ˆ์Šค๋ฅผ ๋Š˜ ๊ฐ์„ฑ ์นดํŽ˜๋ฅผ ์ฐพ์•„๋‹ค๋‹ˆ๋ฉฐ ํ’€๋˜ ๋‚˜๋Š” ๊ฐ์„ฑ ์—†์ด๋Š” ์‚ด ์ˆ˜ ์—†๋Š” ์‚ฌ๋žŒ์ด ๋˜์—ˆ๊ณ 
                        ๊ทธ๋ ‡๊ฒŒ ๋‚˜๋Š” ๊ฐ์„ฑ์ ์ธ ์‚ฌ์ง„๋“ค๋งŒ์„ ์˜ฌ๋ฆฌ๋Š” ์ธ์Šคํƒ€ ๊ณ„์ •์„ ์ƒ์„ฑํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.    
                    </p>
                </div>
                <div class="card__footer">
                    <h4>Minju Kim <em>9 resources</em></h4>
                    <span><img src="img/card_bg03_icon01.png" alt="๊น€๋ฏผ์ฃผ"></span>
                </div>
            </article>
            <article class="card">
                <figure class="card__header">
                    <img src="img/card3_bg02.jpg" alt="๋ฐ•์ง€์ˆ˜์˜ ํฌํŠธํด๋ฆฌ์˜ค">
                    <figcaption># Front-End</figcaption>
                </figure>
                <div class="card__contents">
                    <h3>
                        ์ฝ”๋”ฉ์ฒœ์žฌ ๋ฐ•์ง€์ˆ˜์˜ ํฌํŠธํด๋ฆฌ์˜ค,<br>
                        ํ•œ ๋ฒˆ ๋ณผ๋ž˜?๐Ÿ˜Ž
                    </h3>
                    <p>
                        ์–ด๋ฆฐ ์‹œ์ ˆ๋ถ€ํ„ฐ ๋‚œ ์ด๊ณผ ๋จธ๋ฆฌ์˜€๋‹ค. ํ•™์ฐฝ์‹œ์ ˆ 12๋…„๋™์•ˆ ๋‹จ ํ•œ ๋ฒˆ๋„ ์ˆ˜ํ•™์„ ํฌ๊ธฐํ•œ ์ ์ด ์—†์—ˆ์œผ๋ฉฐ ๊ทธ๋Ÿฐ ๋‚˜์—๊ฒŒ ์ฝ”๋”ฉ์ด๋ž€
                        ๋„ˆ๋ฌด๋‚˜๋„ ์ฆ๊ฑฐ์šด ์ทจ๋ฏธํ™œ๋™์ด์—ˆ์œผ๋ฉฐ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๊ฐœ๋ฐœ์ž๋ฅผ ๊ฟˆ๊พธ๊ฒŒ ๋˜์—ˆ๋‹ค.
                    </p>
                </div>
                <div class="card__footer">
                    <h4>Jisu Park <em>8 resources</em></h4>
                    <span><img src="img/card_bg03_icon02.png" alt="๋ฐ•์ง€์ˆ˜"></span>
                </div>
            </article>
            <article class="card">
                <figure class="card__header">
                    <img src="img/card3_bg03.jpg" alt="ํ•œ๋ฏผ์ฒ ์˜ ํฌํŠธํด๋ฆฌ์˜ค">
                    <figcaption># 3D Artist</figcaption>
                </figure>
                <div class="card__contents">
                    <h3>
                        3D ์•„ํ‹ฐ์ŠคํŠธ๊ฐ€ ๋˜๊ณ  ์‹ถ์€ ํ•œ๋ฏผ์ฒ ์˜<br>
                        ํฌํŠธํด๋ฆฌ์˜ค, ๋ด ์ฃผ์„ธ์š”๐Ÿ˜˜
                    </h3>
                    <p>
                        C4D๋ฅผ ์ฒ˜์Œ ๋ฐฐ์šด ๊ทธ ์ˆœ๊ฐ„ ๋‚˜๋Š” ๊ฒฐ์‹ฌํ–ˆ๋‹ค. ๋ฐ˜๋“œ์‹œ 3D ๊ทธ๋ž˜ํ”ฝ์„ ์ „๊ณตํ•˜๊ฒ ๋‹ค๊ณ  ๋ง์ด๋‹ค. ๋‚œ ์ด ๋ถ„์•ผ์˜ ์•„ํ‹ฐ์ŠคํŠธ๋กœ 
                        ์„ฑ๊ณตํ•ด ๋ˆ๋ฐฉ์„์— ์•‰๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ์•ž์œผ๋กœ ๋‚˜์•„๊ฐˆ ๊ฒƒ์ด๋‹ค.
                    </p>
                </div>
                <div class="card__footer">
                    <h4>Mincheol Han <em>7 resources</em></h4>
                    <span><img src="img/card_bg03_icon03.png" alt="ํ•œ๋ฏผ์ฒ "></span>
                </div>
            </article>
        </div>
    </section>
</body>

CSS ์†Œ์Šค

reset์—์„œ margin๊ฐ’๊ณผ padding๊ฐ’์„ 0์œผ๋กœ ์ดˆ๊ธฐํ™” ์‹œํ‚ค๋Š” ์ž‘์—…๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค.
์ž์„ธํ•œ ์„ค๋ช…์€ ์•„๋ž˜ ์˜ˆ์‹œ ์ฝ”๋“œ์˜ ์ฃผ์„์ฒ˜๋ฆฌ๋œ ๋‚ด์šฉ์„ ์ฐธ์กฐํ•  ๊ฒƒ.

<style>
    /* fonts */
    @import url('https://webfontworld.github.io/score/SCoreDream.css');

    .score {
        font-family: 'SCoreDream';
        font-weight: 300;
    }

    /* reset */
    * {
        margin: 0;
        padding: 0;
    }
    h1, h2, h3, h4, h5, h6 {
        font-weight: normal;
    }
    a {
        text-decoration: none;
        color: #000;
    }
    img {
        width: 100%;    /* ์ด๋ฏธ์ง€ ํŠ€์–ด๋‚˜์˜จ ๊ฑฐ ์ง‘์–ด๋„ฃ๊ธฐ */
    }

    /* common */
    .container {
        width: 1160px;  /* 1200px์—์„œ ์ขŒ์šฐ๋กœ 20px ํŒจ๋”ฉ๊ฐ’ ์ค€๊ฑฐ ๋นผ์„œ 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;
        text-align: center;
        margin-bottom: 70px;
        color: #666;
    }

    /* ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ์—๋Š” ์ฝํžˆ๊ฒŒ ํ•˜๋˜ ๊ฒ‰์œผ๋ก  ์•ˆ๋ณด์ด๊ฒŒ 
        ํ•˜๊ณ ์ž ํ•˜๋Š” ์†์„ฑ์— blind ํด๋ž˜์Šค๊ฐ’ ์ฃผ๊ธฐ */
    .blind {
        position: absolute;
        clip: rect(0 0 0 0);
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
    }

    /* cardType03 */
    body {
        background-color: #2254c3;
    }
    .card__inner {
        display: flex;  /* ํ”Œ๋ ‰์Šค๋กœ ํ•œ ์ค„ ์ •๋ฆฌ */
    }
    .card__inner .card {
        padding: 26px;
        width: 33.333%;
        background-color: #fff;
    }

    /* ์˜ค๋ฅธ์ชฝ ๋ฐฉํ–ฅ์—๋งŒ ์œค๊ณฝ์„  ์ฃผ๊ธฐ */
    .card__inner .card:nth-child(1) {
        border-right: 1px solid #eee;
    }
    .card__inner .card:nth-child(2) {
        border-right: 1px solid #eee;
    }

    .card__header {
        position: relative; /* figcaption์„ ๊ณ ์ •ํ•  ์œ„์น˜ */
    }
    .card__header img {
        border-radius: 10px;
        box-shadow: 4px 4px 5px 0 rgba(0, 0, 0, 0.05);
        margin-bottom: 20px;
    }
    .card__header figcaption {
        padding: 6px 16px;
        border-radius: 50px;
        background-color: #fff;
        position: absolute; /* ์œ„์น˜๋ฅผ card__header์ชฝ์œผ๋กœ ์˜ฎ๊น€ */
        right: 10px;
        top: 10px;
        text-align: center;
        font-size: 14px;
        color: #7b7b7b;
    }

    .card__contents h3 {
        font-size: 20px;
        line-height: 1.4;
        margin-bottom: 10px;
        
        /* 2์ค„ํšจ๊ณผ */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical;
    }
    .card__contents p {
        color: #666;
        font-size: 16px;
        line-height: 1.7;
        margin-bottom: 30px;

        /* 3์ค„ํšจ๊ณผ */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3; 
        -webkit-box-orient: vertical;
    }

    /* ์นด๋“œ ํ•˜๋‹จ ์œ ์ € ์ •๋ณด */
    .card__footer {
        display: flex;  /* ํ”Œ๋ ‰์Šค๋กœ ๋–จ์–ด์ง„ ๊ฒƒ๋“ค ๋ถ™์ด๊ธฐ */
        justify-content: flex-end;  /* ์•„์ดํ…œ ๋(์šฐ์ธก)์œผ๋กœ ์ •๋ ฌ */
    }
    .card__footer h4 {
        text-align: right;
        color: #dd2a2a;
    }
    .card__footer em {
        display: block;
        color: #666;
        font-style: normal;
    }
    .card__footer span {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        display: block;
        margin-left: 10px;
        margin-top: 3px;
        box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.25);
    }
</style>

์ตœ์ข… ๊ฒฐ๊ณผ

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€


Reference Book

JavaScript
HTML
CSS
๊ด‘๊ณ  ์ค€๋น„์ค‘์ž…๋‹ˆ๋‹ค.