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

[SITE] ์›น์‚ฌ์ดํŠธ - ์นด๋“œ ์œ ํ˜•03

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

CardType03

์›นํŽ˜์ด์ง€ ์‹ค์Šต์„ ์œ„ํ•œ ์นด๋“œ ์œ ํ˜• ํŽ˜์ด์ง€ ์‹ฌํ™”ver ์ œ์ž‘ํ•ด๋ณด๊ธฐ!
์นด๋“œ ์•ˆ์— ์ด๋ฏธ์ง€, ํ‚ค์›Œ๋“œ๋ž€, ํ…์ŠคํŠธ ๊ทธ๋ฆฌ๊ณ  ์‚ฌ์šฉ์ž ํ”„๋กœํ•„๊นŒ์ง€ ๋„ฃ์–ด์„œ ์ œ์ž‘ํ•ด๋ณด์ž!


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

์ด๋ฒˆ ์œ ํ˜•์—์„œ๋Š” ์‹ฌํ™” ๋ฒ„์ „์ธ ๋งŒํผ ๊ทธ๋ฆฌ๋“œ ํ•  ์š”์†Œ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค.๐Ÿ˜‚ ์ฐจ๊ทผ์ฐจ๊ทผ ๊ทธ๋ฆฌ๋“œ๋ฅผ ๋งŒ๋“ค์–ด ์นด๋“œํ˜• ํŽ˜์ด์ง€๋ฅผ ๋””์ž์ธ ํ•ด๋ด…์‹œ๋‹ค!
์ด๋ฒˆ ์นด๋“œํ˜• ๋””์ž์ธ์€ ์นด๋“œ ์‚ฌ์ด์— ์—ฌ๋ฐฑ์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋ผ์ธ์„ ๋„ฃ์–ด ์นด๋“œ ์˜์—ญ์„ ๊ตฌ๋ถ„ ํ•ด์ค๋‹ˆ๋‹ค.

TIP ! ์นด๋“œ ์„น์…˜์˜ ๋””์ž์ธ์ด ๋™์ผํ•  ๊ฒฝ์šฐ comtonent๋ฅผ ์ด์šฉํ•˜๋ฉด ํšจ์œจ์ ์ธ ์ž‘์—…์ด ๊ฐ€๋Šฅํ•˜๋‹ค.
comtonent๋ฅผ ์ฒ˜์Œ ์ ์šฉ์‹œํ‚จ ์นด๋“œ๊ฐ€ ์›๋ณธ๊ฐ€ ๋˜๋ฉฐ ์›๋ณธ comtonent๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ๋ณต์ œ comtonent๋“ค๋„ ํ•จ๊ป˜ ์ˆ˜์ •๋˜์–ด ์ž‘์—…์ด ํ›จ์”ฌ ์ˆ˜์›”ํ•ด์ง„๋‹ค!

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

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

TIP ! ๊ตฌ์กฐ๋ฅผ ๋จผ์ € ๊ผผ๊ผผํ•˜๊ฒŒ ํŒŒ์•…ํ•˜์—ฌ ์‹œ๋ฉ˜ํ‹ฑํ•œ ๋งˆํฌ์—…์„ ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€์žฅ ์ค‘์š”ํ•˜๋‹ค. ๋•Œ๋ฌธ์— ๋ณต์žกํ•œ ๊ตฌ์กฐ์ผ ์ˆ˜๋ก ๊ตฌ์กฐ๋ฅผ ์ž˜ ์งœ์ฃผ์–ด์•ผ ์Šคํƒ€์ผ์ด๋‚˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ตฌํ˜„ํ•  ๋•Œ ํšจ์œจ์ ์œผ๋กœ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ตฌ์กฐ๊ฐ€ ๋ณต์žกํ•  ์ˆ˜๋ก ํฐ ๋ฉ์–ด๋ฆฌ๋ถ€ํ„ฐ ์ฒœ์ฒœํžˆ ๋งˆํฌ์—…ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.(css ์†์„ฑ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€!)
=> ์ˆœ์„œ๋Š” ์ปจํ…Œ์ด๋„ˆ ๋ถ€๋ถ„๊นŒ์ง€ ๋งˆํฌ์—…ํ•œ ๋‹ค์Œ css ์†์„ฑ์„ ์ฃผ์–ด์„œ ๋จผ์ € ํฐ ๋ ˆ์ด์•„์›ƒ์„ ์™„์„ฑํ•œ๋‹ค. ๊ทธ ๋‹ค์Œ์œผ๋กœ ํฐ ๋ฉ์–ด๋ฆฌ(+css)๋ฅผ ์ž‘์—…ํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•˜๋‹ค.

<section id="cardType03" class="card__wrap score section">
    <h2 class="blind">์ธํ…Œ๋ฆฌ์–ด ์•Œ์•„๊ฐ€๊ธฐ</h2>
    <div class="card__inner container">
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg03_01.jpg" alt="์ธํ…Œ๋ฆฌ์–ด">
                <figcaption>Keyword</figcaption>
            </figure>
            <div class="card__contents">
                <h3>๊ฐ์„ฑ์ ์ธ ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ํ•ด๋ณด๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ฒฝํ—˜์„ ๊ณต์œ ํ•ด๋ด์š”.</h3>
                <p>๊ฐ์„ฑ์ ์ด๊ณ  ๋”ฐ๋œปํ•œ room ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ๋งŒ๋‚˜๋ณด์„ธ์š”. ๊ทธ๋ฆฌ๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ํ•ด๋ณด์„ธ์š”. ์šฐ๋ฆฌ๋Š” ๊น”๋”ํ•˜๊ณ  ์‹ฌํ”Œํ•œ ๋‹น์‹ ์˜ room์˜ ๋ณ€ํ™”๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.</p>    
            </div>
            <div class="card__footer">
                <h4>SAM KIM<em>SAM KIM</em></h4>
                <span>
                    <img src="img/card_bg03_02.jpg" alt="">
                </span>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg03_01.jpg" alt="์ธํ…Œ๋ฆฌ์–ด">
                <figcaption>Keyword</figcaption>
            </figure>
            <div class="card__contents">
                <h3>ํ†กํ†ก ํŠ€๋Š” ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ํ•ด๋ณด๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ฒฝํ—˜์„ ๊ณต์œ ํ•˜์„ธ์š”.</h3>
                <p>ํ†กํ†ก ํŠ€๋Š” ๋…ํŠนํ•œ room ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ๋งŒ๋‚˜๋ณด์„ธ์š”. ๊ทธ๋ฆฌ๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ํ•ด๋ณด์„ธ์š”. ์šฐ๋ฆฌ๋Š” ํŠน๋ณ„ํ•˜๊ณ  ์œ ๋‹ˆํฌํ•œ ๋‹น์‹ ์˜ room์˜ ๋ณ€ํ™”๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.</p>    
            </div>
            <div class="card__footer">
                <h4>SAM KIM<em>SAM KIM</em></h4>
                <span>
                    <img src="img/card_bg03_02.jpg" alt="">
                </span>
            </div>
        </article>
        <article class="card">
            <figure class="card__header">
                <img src="img/card_bg03_01.jpg" alt="์ธํ…Œ๋ฆฌ์–ด">
                <figcaption>Keyword</figcaption>
            </figure>
            <div class="card__contents">
                <h3>ํ™ˆ ์˜คํ”ผ์Šค ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ํ•ด๋ณด๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ฒฝํ—˜์„ ๊ณต์œ ํ•˜์„ธ์š”.</h3>
                <p>ํ™ˆ ์˜คํ”ผ์Šค๊ฐ™์€ room ์ธํ…Œ๋ฆฌ์–ด๋ฅผ ๋งŒ๋‚˜๋ณด์„ธ์š”. ๊ทธ๋ฆฌ๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ํ•ด๋ณด์„ธ์š”. ์šฐ๋ฆฌ๋Š” ๊น”๋”ํ•˜๊ณ  ๋ชจ๋˜ํ•œ ๋‹น์‹ ์˜ room์˜ ๋ณ€ํ™”๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.</p>    
            </div>
            <div class="card__footer">
                <h4>SAM KIM<em>SAM KIM</em></h4>
                <span>
                    <img src="img/card_bg03_02.jpg" alt="">
                </span>
            </div>
        </article>
    </div>
</section>
! html ์ฃผ์˜์‚ฌํ•ญ !
โ€ข imgํƒœ๊ทธ์˜ ์†์„ฑ ์ค‘ alt์•ˆ์— ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋„ฃ์–ด์ค˜์•ผ ์‹œ๊ฐ ๋ฐ ์ฒญ๊ฐ ์žฅ์• ์ธ๋“ค๋„ ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ๋ฅผ ํ†ตํ•ด ์ดํ•ด ๊ฐ€๋Šฅ
โ€ข img ํƒœ๊ทธ์™€ ๊ฐ™์€ ๊ทธ๋ฆผ, ๋„ํ‘œ ์ž๋ฃŒ ํƒœ๊ทธ๋“ค์€ figure ํƒœ๊ทธ์•ˆ์— ๋„ฃ์–ด์ฃผ๋Š” ๊ฒƒ์ด ์›น ํ‘œ์ค€์„ ์ค€์ˆ˜ํ•œ ๊ฒƒ
โ€ข ์›นํ‘œ์ค€๊ณผ ์›น ์ ‘๊ทผ์„ฑ, ํ˜ธํ™˜์„ฑ์„ ๋†“์น˜์ง€ ์•Š๋„๋กํ•˜์ž!

< CSS ์†Œ์Šค : ์Šคํƒ€์ผ ์ ์šฉํ•˜๊ธฐ >

๊ตฌ์กฐ ์งœ์ž„์˜ ์ˆœ์„œ๋Œ€๋กœ css ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œ์ผœ ๋ด…์‹œ๋‹ค. ์ด ๋•Œ ๋””์ž์ธ ์‹œ์•ˆ์„ ์ฐธ๊ณ ํ•˜๋ฉด์„œ html์™€ ๋ฒˆ๊ฐˆ์•„๊ฐ€๋ฉฐ ํฐ ๋ฉ์–ด๋ฆฌ ๋ถ€ํ„ฐ ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œ์ผœ ๋‚˜๊ฐ€๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
์†์„ฑ์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ์ฝ”๋“œ์™€ ์ฃผ์„์„ ๋ณด๋ฉด์„œ ์ดํ•ดํ•ด๋ด…์‹œ๋‹ค!

TIP !
1. ๋จผ์ € ์ „์ฒด ์ดˆ๊ธฐํ™”(Reset)์™€ ํฐํŠธ ๋””ํดํŠธ ์„ค์ •์„ ํ•ด์ฃผ๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.
2. ์ปจํ…Œ์ด๋„ˆ ์„ค์ •์„ ํ†ตํ•ด ๋ฉ”์ธ ํ™”๋ฉด ํฌ๊ธฐ์™€ ์—ฌ๋ฐฑ์„ ์„ค์ •ํ•ด์ค€ ๋’ค ๋ฉ”์ธ ์ฝ˜ํ…์ธ ์ธ ์„น์…˜์—๊ฒŒ ์Šคํƒ€์ผ์„ ์ ์šฉ์‹œํ‚จ๋‹ค.
3. ์นด๋“œ ์Šคํƒ€์ผ์€ ๋™์ผํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ™์€ ํด๋ž˜์Šค๋ช…์„ ๋„ฃ์–ด์„œ ํ•œ ๋ฒˆ์— ์†์„ฑ์„ ์„ค์ •ํ•ด์ค€๋‹ค.

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

.score {
    font-family: 'SCoreDream';
    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: 1160px;
    background-color: #fff;
}
.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;
}
 /* 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.3333%;
    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;
}
.card__header img {
    border-radius: 10px;
    box-shadow: 4px 4px 5px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}
.card__header figcaption { 
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 6px 16px;
    border-radius: 50px;
    background-color: #fff;
    text-align: center;
    font-size: 14px;
    color: #7B7B7B;
}
.card__contents h3 {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 10px;
    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;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 30px;
}
.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;
    background: #000;
    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);
}

! Css ์†์„ฑ ์•Œ์•„๊ฐ€๊ธฐ !
์„ธ์ค„ ํšจ๊ณผ : ํ…์ŠคํŠธ๊ฐ€ ์„ธ์ค„์„ ๋„˜์–ด๊ฐ€๋ฉด ์ž๋™์œผ๋กœ ...์ฒ˜๋ฆฌ๋ฅผ ํ•ด์ค€๋‹ค.
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;


-->

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

728x90

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css