λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
CSS/Layout_Site

ν…μŠ€νŠΈ μœ ν˜• (2)

by oranssy 2022. 9. 1.
728x90
λ°˜μ‘ν˜•

⭐️ ν…μŠ€νŠΈ μœ ν˜• 02 ⭐️


01. λ ˆμ΄μ•„μ›ƒ κ΅¬μƒν•˜κΈ°

λ ˆμ΄μ•„μ›ƒμ„ ꡬ상할 λ•ŒλŠ”, μŠ€μΌ€μΉ˜ν•˜λ©΄μ„œ μ„ΈλΆ€ λ‚΄μš©μ˜ μ •λ³΄κΉŒμ§€ ꡬ체적으둜 κ³„νšν•©λ‹ˆλ‹€.

02. μƒμž(div) λ§Œλ“€κΈ° : <body>

        <section id="textType 02" class="text__wrap gmarket section">
    <h2 class="blind">λ‘λ²ˆμ§Έ ν…μŠ€νŠΈ μœ ν˜• μž…λ‹ˆλ‹€.</h2>
    <div class="text__inner container">
        <article class="text__header">
            <figcaption>ν…μŠ€νŠΈ μœ ν˜• 02</figcaption>
            <div class="text__cont">
                <h3>νœ΄λŒ€ν° μ—°λ½ν•˜κΈ° <br> μ•„μ΄μ½˜ μ„€λͺ…μ„œ</h3>
                <p>
                    νœ΄λŒ€ν°μœΌλ‘œ μ—°λ½ν•˜κΈ° μœ„ν•œ <br> μ•„μ΄μ½˜μ— λŒ€ν•΄ μ•Œμ•„λ΄…μ‹œλ‹€. <br> μ•„μ΄μ½˜ λͺ¨μ–‘을 κΈ°μ–΅ν•΄μ£Όμ„Έμš”!
                </p>
            </div>
        </article>
        <article class="text">
            <figure class="text__icon">
                <img src="img/text_bg02_icon01.png" alt="μ—°λ½μ²˜ μ•„μ΄μ½˜">
            </figure>
            <div class="text__box">
                <h3 class="tit">μ—°λ½μ²˜ 보기</h3>
                <p class="desc">
                    μ•„μ΄μ½˜μ„ λˆ„λ₯΄λ©΄ 화면이 λ°”λ€λ‹ˆλ‹€. 바뀐 ν™”λ©΄μ—μ„œ μ›ν•˜λŠ” λ™μž‘μ„ μ™„λ£Œν•˜μ‹­μ‹œμ˜€. ν™”λ©΄μ˜ μ•„μ΄μ½˜μ€ 길게 λˆ„λ₯΄μ§€ μ•Šμ•„λ„ λˆŒλ¦½λ‹ˆλ‹€. 화면에 μžˆλŠ” μ•„μ΄μ½˜μ„
                </p>
            </div>
        </article>
        <article class="text">
            <figure class="text__icon">
                <img src="img/text_bg02_icon02.png" alt="톡화 μ•„μ΄μ½˜">
            </figure>
            <div class="text__box">
                <h3 class="tit">ν†΅ν™”ν•˜κΈ°</h3>
                <p class="desc">
                    μ•„μ΄μ½˜μ„ λˆ„λ₯΄λ©΄ 화면이 λ°”λ€λ‹ˆλ‹€. 바뀐 ν™”λ©΄μ—μ„œ μ›ν•˜λŠ” λ™μž‘μ„ μ™„λ£Œν•˜μ‹­μ‹œμ˜€. ν™”λ©΄μ˜ μ•„μ΄μ½˜μ€ 길게 λˆ„λ₯΄μ§€ μ•Šμ•„λ„ λˆŒλ¦½λ‹ˆλ‹€. 화면에 μžˆλŠ” μ•„μ΄μ½˜μ„
                </p>
            </div>
        </article>
        <article class="text">
            <figure class="text__icon">
                <img src="img/text_bg02_icon03.png" alt="메세지 μ•„μ΄μ½˜">
            </figure>
            <div class="text__box">
                <h3 class="tit">메세지 보내기</h3>
                <p class="desc">
                    μ•„μ΄μ½˜μ„ λˆ„λ₯΄λ©΄ 화면이 λ°”λ€λ‹ˆλ‹€. 바뀐 ν™”λ©΄μ—μ„œ μ›ν•˜λŠ” λ™μž‘μ„ μ™„λ£Œν•˜μ‹­μ‹œμ˜€. ν™”λ©΄μ˜ μ•„μ΄μ½˜μ€ 길게 λˆ„λ₯΄μ§€ μ•Šμ•„λ„ λˆŒλ¦½λ‹ˆλ‹€. 화면에 μžˆλŠ” μ•„μ΄μ½˜μ„
                </p>
            </div>
        </article>
        <article class="text">
            <figure class="text__icon">
                <img src="img/text_bg02_icon04.png" alt="νŽΈμ§‘ μ•„μ΄μ½˜">
            </figure>
            <div class="text__box">
                <h3 class="tit">κΈ€μ“°κΈ° / μˆ˜μ •ν•˜κΈ°</h3>
                <p class="desc">
                    μ•„μ΄μ½˜μ„ λˆ„λ₯΄λ©΄ 화면이 λ°”λ€λ‹ˆλ‹€. 바뀐 ν™”λ©΄μ—μ„œ μ›ν•˜λŠ” λ™μž‘μ„ μ™„λ£Œν•˜μ‹­μ‹œμ˜€. ν™”λ©΄μ˜ μ•„μ΄μ½˜μ€ 길게 λˆ„λ₯΄μ§€ μ•Šμ•„λ„ λˆŒλ¦½λ‹ˆλ‹€. 화면에 μžˆλŠ” μ•„μ΄μ½˜μ„
                </p>
            </div>
        </article>
    </div>
</section>

02. style(css) μ„€μ •ν•˜κΈ° : <style>

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

    .gmarket {
        font-family: 'GmarketSans';  /* 폰트 지정 */
        font-weight: 300;    /* 폰트 λ‘κ»˜ μ„€μ • */
    }

    /* 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;    /* κ°€μš΄λ° μ •λ ¬ */
        min-width: 1160;
    }
    .section {
        padding: 120px 0;
    }

    /* blind */
    .blind {
        position: absolute;
        clip: rect(0 0 0 0);
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
    }

    /* textType 02 */
    .text__inner {
        display: grid;
        grid-template-areas: 
            "box1 box2 box3"
            "box1 box4 box5"
        ;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        grid-gap: 20px;
    }
    .text__inner .text__header {
        grid-area: box1;
    }
    .text__inner .text:nth-child(1) {
        grid-area: box2;
    }
    .text__inner .text:nth-child(2) {
        grid-area: box3;
    }
    .text__inner .text:nth-child(3) {
        grid-area: box4;
    }
    .text__inner .text:nth-child(4) {
        grid-area: box5;
    }

    .text__header {
        /* background-color: #D9D9D9; */
    }
    .text__header:hover {
        background-color: #f3f3f3;
    }
    .text__header figcaption {
        width: 177px;
        height: 30px;
        background-color: #2152FF;
        border-radius: 50px;
        color: #fff;
        font-size: 20px;
        font-weight: 500;
        text-align: center;
        line-height: 34px;
        margin-bottom: 20px;
    }
    .text__cont {}
    .text__cont > h3 {
        font-size: 50px;
        font-weight: 700;
        margin-bottom: 40px;
    }
    .text__cont > p {
        font-size: 20px;
        font-weight: 500;
        line-height: 1.4;
    }
    .text {
        /* background-color: #D7D7D7; */
        height: 210px;
    }
    .text:hover {
        background-color: #f3f3f3;
    }
    .text__icon {}
    .text__icon img {
        width: 60px;
        margin-bottom: 10px;
    }
    .text__box {
        margin-bottom: 50px;
    }
    .text__box .tit {
        font-size: 24px;
        margin-bottom: 20px;
    }
    .text__box .desc {
        font-size: 18px;
        font-weight: 500;
        line-height: 1.4;
        color: #666;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;   /* clamp μ€„λ°”κΏˆ 3쀄 이상 되면 ... 으둜 λ°”λ€œ - '3쀄 효과' κ²€μƒ‰ν•΄μ„œ μ‚¬μš© */
        -webkit-box-orient: vertical;
    }

03. 결과보기

728x90
λ°˜μ‘ν˜•

'CSS > Layout_Site' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

이미지 ν…μŠ€νŠΈ μœ ν˜• (1)  (3) 2022.09.02
ν…μŠ€νŠΈ μœ ν˜• (3)  (2) 2022.09.01
ν…μŠ€νŠΈ μœ ν˜• (1)  (2) 2022.09.01
이미지 μœ ν˜• (3)  (2) 2022.08.22
이미지 μœ ν˜• (2)  (2) 2022.08.18

λŒ“κΈ€