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

[์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ] ์ด๋ฏธ์ง€ ์œ ํ˜• 01 - ์ด๋ฏธ์ง€ ์œ„์— ์„ค๋ช…, ๋ฒ„ํŠผ ๋„ฃ๊ธฐ

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

์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ : ์ด๋ฏธ์ง€ ์œ ํ˜• 01

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” Figma์—์„œ ๋งŒ๋“  ์ด๋ฏธ์ง€ ์œ ํ˜• ์„น์…˜์„ HTML๊ณผ CSS ์ฝ”๋“œ๋กœ ์˜ฎ๊ธฐ๋Š” ์ž‘์—…์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.


Figma

๋จผ์ € ๋งŒ๋“ค๊ณ ์ž ํ•˜๋Š” ์›น ์‚ฌ์ดํŠธ์˜ ๋ชจ์–‘์„ Figma๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•˜์—ฌ ์•„๋ž˜์™€ ๊ฐ™์ด ๋งŒ๋“ค์–ด์ฃผ๋„๋ก ํ•˜์ž.
์ด๋ฒˆ์— ๋งŒ๋“ค ์›น ์‚ฌ์ดํŠธ์˜ ์œ ํ˜•์€ ์ด๋ฏธ์ง€ ์œ„์— ์ œ๋ชฉ๊ณผ ๋ณธ๋ฌธ(์„ค๋ช…), ๋ฒ„ํŠผ์„ ์˜ฌ๋ ค๋†“๋Š” ๊ฐ„๋‹จํ•œ ๋ฐฉ์‹์ด๋‹ค.

HTML ์†Œ์Šค

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

<body>
    <section id="imageType01" class="image__wrap nexon section">
        <h1>๋ณ„๋น› ์ œ๋นต๊ต์‹ค ๊ฐœ๊ฐ•์†Œ์‹๐Ÿž</h1>
        <p>๋ณ„๋น› ์ œ๋นต๊ต์‹ค์ด 2022๋…„ 8์›” 23์ผ ๊ฐœ๊ฐ•ํ•ฉ๋‹ˆ๋‹ค. ์ˆ˜๊ฐ•์‹ ์ฒญ ๊ธฐํšŒ๋Š” ์ง€๊ธˆ ๋ฟ์ด๋‹ˆ ์„œ๋‘๋ฅด์„ธ์š”!</p>
        <div class="image__inner container">
            <article class="image img1">
                <h3 class="image__title">๋‚˜๋งŒ์˜ ์ œ๋นต ํฌํŠธํด๋ฆฌ์˜ค</h3>
                <p class="image__desc">
                    ์ž์‹ ๋งŒ์˜ ์ œ๋นต ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋„๋ก ๋•๊ฒ ์Šต๋‹ˆ๋‹ค. 
                    ์—ด์‹ฌํžˆ๋งŒ ํ•œ๋‹ค๋ฉด ์™„์ „ ์ˆ˜๋ฃŒํ•  ๋•Œ ์ฆˆ์Œ์—๋Š” ๋‹น์‹ ๋„ ํ›Œ๋ฅญํ•œ ์ œ๋นต์‚ฌ!
                </p>
                <a class="image__btn" href="/" title="์ž์„ธํžˆ ๋ณด๊ธฐ">
                    ์ž์„ธํžˆ ๋ณด๊ธฐ
                </a>
            </article>
            <article class="image img2">
                <h3 class="image__title">๋‚˜๋งŒ์˜ ์ œ๋นต ํฌํŠธํด๋ฆฌ์˜ค</h3>
                <p class="image__desc">
                    ์ž์‹ ๋งŒ์˜ ์ œ๋นต ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋„๋ก ๋•๊ฒ ์Šต๋‹ˆ๋‹ค. 
                    ์—ด์‹ฌํžˆ๋งŒ ํ•œ๋‹ค๋ฉด ์™„์ „ ์ˆ˜๋ฃŒํ•  ๋•Œ ์ฆˆ์Œ์—๋Š” ๋‹น์‹ ๋„ ํ›Œ๋ฅญํ•œ ์ œ๋นต์‚ฌ!
                </p>
                <a class="image__btn" href="/" title="์ž์„ธํžˆ ๋ณด๊ธฐ">
                    ์ž์„ธํžˆ ๋ณด๊ธฐ
                </a>
            </article>
        </div>
    </section>
</body>

CSS ์†Œ์Šค

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

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

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

    /* 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;
        padding: 0 20px;
        margin: 0 auto;
        min-width: 1160px;  /* ๋ฐ˜์‘ํ˜• ํ•  ๋•Œ ์—†์• ์ค„ ๊ฒƒ */
    }
    .section {
        padding: 120px 0;
    }
    .section > h1 {
        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;
    }

    /* imageType */
    .image__inner {
        display: flex;
        justify-content: space-between;     /* ๊ฐ„๊ฒฉ ๋–จ์–ด๋œจ๋ฆฌ๊ธฐ */
    }
    .image {
        width: 49%;
        height: 370px;
        padding: 200px 30px 30px 30px;
        color: #fff;
        box-sizing: border-box;
    }
    .image.img1 {
        background: url(img/imageType01_bg01.jpg) no-repeat center;
    }
    .image.img2 {
        background: url(img/imageType01_bg02.jpg) no-repeat center;
    }
    .image__title {
        font-size: 32px;
        margin-bottom: 10px;
    }
    .image__desc {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 10px;
        font-weight: 300;
        /* 2์ค„ํšจ๊ณผ : ๊ธ€์ด ๋„˜์ณ๋„ 2์ค„์„ ๋„˜์ง€ ์•Š๋„๋ก ํ•ด์คŒ */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        padding-right: 30px;
    }
    .image__btn {
        background-color: rgba(96, 52, 0, 0.8);
        padding: 10px 15px;
        font-size: 16px;
        font-weight: 300;
        color: #fff;
        display: inline-block;
    }
</style>

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

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€


Reference Book

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