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

[SITE] ์›น์‚ฌ์ดํŠธ - ์ด๋ฏธ์ง€ ์œ ํ˜•01

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

Image Type01

์›นํŽ˜์ด์ง€ ์‹ค์Šต์„ ์œ„ํ•œ ์ด๋ฏธ์ง€ ์œ ํ˜• ํŽ˜์ด์ง€ ์ œ์ž‘ํ•ด๋ณด๊ธฐ!
์ด๋ฒˆ ์ด๋ฏธ์ง€ ์œ ํ˜•์—์„œ๋Š” background์— image๋ฅผ ๋„ฃ์–ด์„œ ์ž‘์—…ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!


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

์ด๋ฏธ์ง€ ์œ ํ˜•์˜ ๊ฐ€์žฅ ๊ธฐ์ดˆ์ ์ธ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ์ด๋ฏธ์ง€ ๋ฐ•์Šค ์•ˆ์— ํ…์ŠคํŠธ์™€ ๋งํฌ ๋ฐ•์Šค๊ฐ€ ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ๊ตฌ์กฐ์ž…๋‹ˆ๋‹ค.

TIP ! ์—ฌ๋ฐฑ์€ 10๋‹จ์œ„๋กœ ํ•ด์ฃผ์–ด์„œ ์ข€ ๋” ํšจ์œจ์ ์œผ๋กœ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค:)

๐ŸŽจ ๊ทธ๋ฆฌ๋“œ์™€ ๋ ˆ์ด์•„์›ƒ

๐ŸŽจ ์™„์„ฑ๋ณธ


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

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

! TIP ! ์„น์…˜ ํƒœ๊ทธ์— ์„น์…˜ ์„ ํƒ์ž๋ฅผ ๋”ฐ๋กœ ์ค€ ์ด์œ ๋Š” ์•ž์œผ๋กœ ๋งŒ๋“ค๊ฒŒ ๋  ์œ ํ˜•๋“ค ๋ชจ๋‘ ๊ณตํ†ต์ ์œผ๋กœ ์„น์…˜ ์•ˆ์— ์ œ๋ชฉ, contents ๊ตฌ์กฐ๋กœ ๋“ค์–ด๊ฐ€๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
์ฆ‰ css ์†์„ฑ์„ ์žฌํ™œ์šฉ ํ•˜๊ธฐ ์œ„ํ•œ ์„ ํƒ์ž๋ผ๊ณ  ๋ณด๋ฉด ๋ฉ๋‹ˆ๋‹ค๐Ÿคฃ

<section id="imageType01" class="image__wrap Nexon section"> 
    <h2>๊ท€์—ฌ์šด ๋™๋ฌผ๋“ค</h2>
    <p>๐Ÿถ ๋™๋ฌผ์„ ์ข‹์•„ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์„ ์œ„ํ•œ ๋™๋ฌผ ๋ฆฌ์ŠคํŠธ ์ž…๋‹ˆ๋‹ค. ๐Ÿฑ</p>
    <div class="image__inner container">
        <article class="image img1">
            <h3 class="image__title">๊ท€์—ฌ์šด ๋™๋ฌผ ๊ฐ•์•„์ง€</h3>
            <p class="image__desc">๊ฐ•์•„์ง€๋Š” ๋งค์šฐ ๊ท€์—ฝ์Šต๋‹ˆ๋‹ค. ํ™œ๋™์ ์ธ ๋ชจ์Šต์ด ๊ท€์—ฝ์Šต๋‹ˆ๋‹ค. ๊ฐ•์•„์ง€๋Š” ๊ธฐ๋ปํ•  ๋•Œ๋„ ๊ท€์—ฝ๊ณ  ์‹œ๋ฌด๋ฃฉํ•  ๋•Œ๋„ ๊ท€์—ฝ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ƒฅ ๊ท€์—ฝ์Šต๋‹ˆ๋‹ค. </p>
            <a href="#" title="์ž์„ธํžˆ ๋ณด๊ธฐ" class="image__btn">์ž์„ธํžˆ ๋ณด๊ธฐ</a>
        </article>
        <article class="image img2">
            <h3 class="image__title">๊ท€์—ฌ์šด ๋™๋ฌผ ๊ณ ์–‘์ด</h3>
            <p class="image__desc">๊ณ ์–‘์ด๋Š” ๋งค์šฐ ๊ท€์—ฝ์Šต๋‹ˆ๋‹ค. ๋„๋„ํ•˜๋ฉด์„œ๋„ ์• ๊ต๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค. ๊ณ ์–‘์ด๋Š” ์€๊ทผํ•˜๊ฒŒ ๋‹ค๊ฐ€์˜ค๋Š” ๊ฒƒ์ด ๋งค๋ ฅ์ ์ž…๋‹ˆ๋‹ค. </p>
            <a href="#" title="์ž์„ธํžˆ ๋ณด๊ธฐ" class="image__btn yellow">์ž์„ธํžˆ ๋ณด๊ธฐ</a>
        </article>
    </div>
</section>
! html ์ฃผ์˜์‚ฌํ•ญ !
โ€ข imgํƒœ๊ทธ์˜ ์†์„ฑ ์ค‘ alt์•ˆ์— ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋„ฃ์–ด์ค˜์•ผ ์‹œ๊ฐ ๋ฐ ์ฒญ๊ฐ ์žฅ์• ์ธ๋“ค๋„ ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ๋ฅผ ํ†ตํ•ด ์ดํ•ด ๊ฐ€๋Šฅ
โ€ข ์„น์…˜๊ณผ ์•„ํ‹ฐํด ํƒœ๊ทธ์—๋Š” ๊ผญ ์ œ๋ชฉ ํƒœ๊ทธ๋ฅผ ์ž์‹ ์š”์†Œ๋กœ ๋„ฃ์–ด ์ฃผ์–ด์„œ ์›นํ‘œ์ค€๊ณผ ์›น ์ ‘๊ทผ์„ฑ, ํ˜ธํ™˜์„ฑ์„ ๋†“์น˜์ง€ ์•Š๋„๋ก ํ•˜์ž!

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

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

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

@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');
/* font */
.Nexon {
    font-family: 'NexonLv1Gothic';
    font-weight: 400;
}

/* reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
a {
    text-decoration: none;
    color: #000;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}

/* common : ๊ณตํ†ต ์š”์†Œ(์žฌํ™œ์šฉ) */
.container {
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
    /* background: rgba(204, 204, 204, 0.363); */
}
.section {
    padding: 120px 0;
}
.section > h2 {
    font-size: 50px;
    margin-bottom: 20px;
    text-align: center;
}
.section > p {
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 70px;
    text-align: center;
    color: #666;
}

/* imageType */
.image__inner {
    display: flex;
    justify-content: space-between;
}
.image {
    width: 49%;
    height: 370px;
    color: #fff;
    padding: 200px 30px 30px 30px;
}
.image.img1 {
    background: url(img/img_bg01_01.jpg) no-repeat center;
}
.image.img2 {
    background: url(img/img_bg01_02.jpg) no-repeat center;
}
.image__title {
    font-size: 32px;
    margin-bottom: 10px;
}
.image__desc {
    font-size: 16px;
    font-weight: 300;
    margin-bottom: 10px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}
.image__btn {
    font-size: 16px;
    font-weight: 300;
    color: #fff;
    padding: 10px 20px;
    display: inline-block;
    background: #a7844f;
}
.image__btn.yellow {
    background: #687553;
}

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

! Css ์†์„ฑ ์•Œ์•„๊ฐ€๊ธฐ !
๋ฐฑ๊ทธ๋ผ์šด๋“œ: url() : ์ด๋ฏธ์ง€๋ฅผ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์— ์‚ฝ์ž…ํ•œ๋‹ค.
background: url(img/img_bg01_01.jpg) no-repeat center;
no-repeat center : ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง€๋ฅผ ๋ฐ˜๋ณตํ•˜์ง€ ์•Š๊ณ  ๊ฐ€์šด๋ฐ๋กœ ์˜ค๊ฒŒ ํ•˜๋Š” ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์†์„ฑ์ด๋‹ค.


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

728x90

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css