๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
CSS/Layout_Site

์นด๋“œ ์œ ํ˜• (2)

by oranssy 2022. 8. 10.
728x90
๋ฐ˜์‘ํ˜•

โญ๏ธ ์นด๋“œ ์œ ํ˜• 02 โญ๏ธ


01. ๋ ˆ์ด์•„์›ƒ ๊ตฌ์ƒํ•˜๊ธฐ

๋ ˆ์ด์•„์›ƒ์„ ๊ตฌ์ƒํ•˜๊ณ , ์–ด๋–ค ์ •๋ณด์˜ ๋‚ด์šฉ์„ ๋‹ด์„์ง€๋„ ๊ตฌ์ฒด์ ์œผ๋กœ ์Šค์ผ€์น˜ํ•ฉ๋‹ˆ๋‹ค.

02. div ๋งŒ๋“ค๊ธฐ

section ์„ ์‹œ๋ฉ˜ํ‹ฑ ๋งˆํฌ์—…ํ•˜๊ณ , id ๋กœ ์ด๋ฆ„์„ ์ง€์–ด์ค๋‹ˆ๋‹ค.
ํฐ div ์ƒ์ž๋ฅผ ๋งŒ๋“ค๊ณ , ์ •ํ™•ํ•œ ๊ฒฝ๋กœ์— ๋”ฐ๋ฅธ style ์„ค์ •์„ ์œ„ํ•ด class ๋กœ ์ด๋ฆ„์„ ์ง€์–ด์ค๋‹ˆ๋‹ค.
์„ธ๋ถ€ div ์ƒ์ž๋ฅผ ๋งŒ๋“ค๊ณ , ์ •๋ณด์˜ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<section id="cardType" class="card__wrap Gmarket section">
    <h2>์ธํ…Œ๋ฆฌ์–ด ๋‘˜๋Ÿฌ๋ณด๊ธฐ</h2>
    <p>์ธํ…Œ๋ฆฌ์–ด ๋””์ž์ธ์„ ์œ„ํ•œ ์ด๋ฏธ์ง€ ๋ชจ์Œ ์ž๋ฃŒ ์ž…๋‹ˆ๋‹ค. <br>
        ๋ผ์ดํ”„ ์Šคํƒ€์ผ์— ๋”ฐ๋ผ ๋‚˜๋ˆ ์ง„ ๋‹ค์–‘ํ•œ ๋””์ž์ธ์„ ์‚ดํŽด๋ณด์„ธ์š”. ๐Ÿ’๐Ÿฝ</p>
    <div class="card__inner container">
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg04.jpg" alt="๋ถ์œ ๋Ÿฝ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ๋ถ์œ ๋Ÿฝ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">๋ถ์œ ๋Ÿฝ ๊ธฐํ›„์— ๋งž๊ฒŒ ํ™”์ดํŠธ ์ปฌ๋Ÿฌ๋ฅผ ๊ธฐ๋ณธ์œผ๋กœ ๊ฐ•ํ•œ ๊ทธ๋ ˆ์ด๋‚˜ ๋ธ”๋ž™์„ ํฌ์ธํŠธ๋กœ ์ฃผ๋Š” ๊ฒƒ์ด ํŠน์ง•์ด๋ฉฐ, ์‹ค์šฉ...</p>

            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg05.jpg" alt="์›จ์ธ์Šค์ฝ”ํŒ… ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ์›จ์ธ์Šค์ฝ”ํŒ… ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">์›จ์ธ์Šค์ฝ”ํŒ…์€ ๋ฒฝ์˜ ์ผ์ • ๋ถ€๋ถ„์„ ์‚ฌ๊ฐ ํ”„๋ ˆ์ž„ ํ˜•ํƒœ๋กœ ํŒจ๋„์„ ๋ง๋Œ€๋Š” ์‹œ๊ณต๋ฒ•์œผ๋กœ, ํด๋ž˜์‹ํ•œ ๋ถ„์œ„๊ธฐ์—์„œ ํ˜„...</p>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg06.jpg" alt="ํ”„๋ Œ์น˜ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ํ”„๋ Œ์น˜ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">ํ”„๋ Œ์น˜ ์‹œํฌ์˜ ์ž์—ฐ์Šค๋Ÿฌ์šฐ๋ฉด์„œ๋„ ํŽธ์•ˆํ•œ ๊ฐ์„ฑ์„ ์žฌํ•ด์„ํ•œ ๋””์ž์ธ์œผ๋กœ, ๊ณ ์ „์ ์ด๊ณ  ๋กœ๋งจํ‹ฑํ•œ ๋Š๋‚Œ์˜...</p>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg07.jpg" alt="ํ”Œ๋žœํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ํ”Œ๋žœํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">์‹๋ฌผ์ด ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ดˆ๋ก์ƒ‰์œผ๋กœ ์ž์—ฐ์นœํ™”์ ์ด๊ณ  ๋‚ด์ถ”๋Ÿดํ•œ ํฌ์ธํŠธ๋ฅผ ์ค€ ์ธํ…Œ๋ฆฌ์–ด๋กœ, ํž๋ง์˜ ์š”์†Œ๋ฅผ...</p>
            </div>
        </article>
    </div>
    <div class="card__inner container">
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg08.jpg" alt="๋ชจ๋˜ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ๋ชจ๋˜ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">๋ชจ๋˜์€ ๋„์‹œ์ , ํ˜„๋Œ€์ , ์„ธ๋ จ๋จ์„ ๋œปํ•˜๋ฉฐ, ๋ชจ๋˜ ์ธํ…Œ๋ฆฌ์–ด์—์„œ๋Š” ๋‚œ์ƒ‰๊ณ„์—ด ๋ณด๋‹ค๋Š” ๋ฌด์ฑ„์ƒ‰์„ ๋งŽ์ด ์‚ฌ์šฉํ•˜...</p>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg09.jpg" alt="๋ฏธ๋‹ˆ๋ฉ€ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ๋ฏธ๋‹ˆ๋ฉ€ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">19์„ธ๊ธฐ ์ดˆ์˜ ๋ชจ๋”๋‹ˆ์ฆ˜์ด ๋ฐœ์ „๋œ ํ˜•ํƒœ๋กœ, ์ตœ๋Œ€ํ•œ ์žฅ์‹์„ ๋ฐฐ์ œํ•˜๊ณ  ๊ฐ„๊ฒฐํ•˜๊ณ  ๊ฐ„์†Œํ™”ํ•œ ํŠน์ง•์„ ๊ฐ€์ง€๋Š” ์ธ...</p>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg10.jpg" alt="๋นˆํ‹ฐ์ง€ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ๋นˆํ‹ฐ์ง€ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">๋นˆํ‹ฐ์ง€๋Š” ์™€์ธ ์šฉ์–ด์—์„œ ์œ ๋ž˜๋œ ๋‹จ์–ด๋กœ, ์˜ค๋ž˜๋˜๊ณ  ๋‚ก์€ ํ˜•ํƒœ๋ฅผ ๋œปํ•ฉ๋‹ˆ๋‹ค. ์‹œ๊ฐ„์ด ์ง€๋‚œ ๋น›๋ฐ”๋žœ ์šฉํ’ˆ๋“ค๋กœ...</p>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg11.jpg" alt="์ธ๋”์ŠคํŠธ๋ฆฌ์–ผ ์ธํ…Œ๋ฆฌ์–ด">
            </figure>
            <div class="card__body">
                <h3 class="tit">
                    ์ธ๋”์ŠคํŠธ๋ฆฌ์–ผ ์ธํ…Œ๋ฆฌ์–ด
                    <a class="btn" href="/">
                        <span aria-hidden="true">              
                            <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0 5C0 2.23858 2.23858 0 5 0H23C25.7614 0 28 2.23858 28 5V23C28 25.7614 25.7614 28 23 28H5C2.23858 28 0 25.7614 0 23V5Z" fill="#C59980"/>
                                <path d="M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44772 15 7 15V13ZM21.7071 14.7071C22.0976 14.3166 22.0976 13.6834 21.7071 13.2929L15.3431 6.92893C14.9526 6.53841 14.3195 6.53841 13.9289 6.92893C13.5384 7.31946 13.5384 7.95262 13.9289 8.34315L19.5858 14L13.9289 19.6569C13.5384 20.0474 13.5384 20.6805 13.9289 21.0711C14.3195 21.4616 14.9526 21.4616 15.3431 21.0711L21.7071 14.7071ZM7 15H21V13H7V15Z" fill="white"/>
                            </svg>
                        </span>
                    </a>
                </h3>
                <p class="desc">๊ฑฐ์นœ ๋Š๋‚Œ์˜ ์ฐฝ๊ณ ๋‚˜ ๊ณต์žฅ์˜ ๋Š๋‚Œ์ด ๊ฐ€๋ฏธ๋œ ๋นˆํ‹ฐ์ง€ ์ธํ…Œ๋ฆฌ์–ด๋กœ, ๋‹ค์†Œ ์–ด๋‘ก์ง€๋งŒ ๋ฌต์งํ•˜๊ณ  ๊ฐ•ํ•œ ์ธ์ƒ์„...</p>
            </div>
        </article>
    </div>
</section>

02. style ์„ค์ •ํ•˜๊ธฐ

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

    .Gmarket {                         /* ํฐํŠธ ๋ณ€๊ฒฝ */
        font-family: 'GmarketSans';
        font-weight: 400;
    }
    
    /* reset */
    * {
        margin: 0;
        padding: 0;
    }
    .img {
        width: 100%;
    }
    h1, h2, h3, h4, h5, h6 {
        font-weight: 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;
        margin-bottom: 20px;
        text-align: center;
    }
    .section > p {
        font-size: 22px;
        font-weight: 200;
        line-height: 1.2;
        margin-bottom: 70px;
        color: #666;
        text-align: center;
    }

    /* cardtype */
    .card {
        width: 275px;
        background-color: #fff;
    }
    .card__inner {
        display: flex;
        justify-content: space-between;
    }
    .card__header{
        padding-bottom: 20px;
    }
    .card__body {
        margin-bottom: 50px;
    }
    .card__body .tit {
        font-size: 24px;
        font-weight: 400;
        margin-bottom: 10px;
        position: relative;   /* ํ™”์‚ดํ‘œ ์œ„์น˜ ์„ค์ • */
    }
    .card__body .desc {
        font-size: 18px;
        font-weight: 100;
        line-height: 1.4;
        color: #666;
    }
    .card__body .btn {
        position: absolute;     /* ํ™”์‚ดํ‘œ ์œ„์น˜ ์„ค์ • */
        right: 0;
    }

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

728x90
๋ฐ˜์‘ํ˜•

'CSS > Layout_Site' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

์ด๋ฏธ์ง€ ์œ ํ˜• (3)  (2) 2022.08.22
์ด๋ฏธ์ง€ ์œ ํ˜• (2)  (2) 2022.08.18
์ด๋ฏธ์ง€ ์œ ํ˜• (1)  (4) 2022.08.17
์นด๋“œ ์œ ํ˜• (3)  (8) 2022.08.11
์นด๋“œ ์œ ํ˜• (1)  (8) 2022.08.09

๋Œ“๊ธ€