์ฌ์ดํธ ๋ง๋ค๊ธฐ : ํ ์คํธ ์ ํ STUDY 03
์ด๋ฒ ํฌ์คํ
์์๋ Figma์์ ๋ง๋ ํ
์คํธ ์ ํ ์น์
์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์
์
ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
์์ด์ฝ ์ถ๋ ฅ์ ์์ด์ฝ์ด ๋ค์ด๊ฐ ์์ ๋จผ์ ์ฝ๋ฉ์ผ๋ก ๋ง๋ค์ด ๋ธ ํ, ์์ด์ฝ์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ๊ธฐ๋ฒ์ผ๋ก ์ ์์ ๋ฃ๋ ์์ผ๋ก ์ฝ๋ฉ์
์งํํ์์ต๋๋ค.
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์. ๊ทธ์ ๋์์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ์ฉ ์์ด์ฝ SVG๋ฅผ ์ถ๋ ฅํ ํ์ด์ง๋ ๋ฐ๋ก ๋ง๋ค๋๋ก ํ๋ค. ๋ง๋๋ ๋ฐฉ๋ฒ์ ์ง๋ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ํฌ์คํ ์ ์ฐธ์กฐํ ๊ฒ.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๋๋ก ํ์. img ํ๊ทธ์ alt์ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์ํด ์์ด์ฝ์ด ๋ค์ด๊ฐ span ํ๊ทธ์ ํด๋์ค ๊ฐ์ "ir"๋ก ์ค์ ํ์. ์์ธํ ์ค๋ช ์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="cardType03" class="card__wrap gmarket section">
<h2>๊ฐ์์ ๋ํด ์ด์ผ๊ธฐํด๋ณด์๐พ</h2>
<p>๊ณง ๋ค๊ฐ์ฌ ๊ฐ์์ ๋ํ์ฌ ์ด๋ฐ์ ๋ฐ ์ด์ผ๊ธฐ๋ค์ ํด๋ณด์์!</p>
<div class="card__inner container">
<article class="card">
<div class="card__body">
<p class="desc">
๋น์ผ์ธ์ธ ๋์๊ฒ ๊ฐ์ฅ ๊ณ ํต์ค๋ฌ์ด ๊ณ์ ์ด ๋์์๋ค. ๋ง์ ์ด๋ค์ด ์ข์ํ๋ ๋ด๊ณผ ๊ฐ์์ ์ซ์ดํ๋ ์ด์ ๋ ์ด ๋น์ด๋จน์ ๋น์ผ ๋๋ฌธ์ด์งโฆ ์ค๋๋ ์ฝง๋ฌผ์ด ์ด์์์ด ํ๋ฅด๋๊ตฌ๋๐คง ๋นจ๋ฆฌ ํ์ ๊ธฐ๊ฐ ๋๋๊ณ ๊ฒจ์ธ์ด ์ฐพ์์์ผ๋ฉด ์ข๊ฒ ๋ค. ๋ ๊ฒจ์ธ์ด ์ ์ผ ์ข์๐ฅถ
</p>
<hr>
<div class="profile">
<span id="card__icon" class="icon__logo1" aria-hidden="๊น๋ช
ํฌ">
<a href="#" class="link1"><span class="ir">๊น๋ช
ํฌ</span></a>
</span>
<div class="user__name">
<h2>๊น๋ช
ํฌ</h2>
<p>@mh123</p>
<span id="star">
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_empty"><span class="ir">๋ณ ๋น์์ง</span></a>
<a class="star_empty"><span class="ir">๋ณ ๋น์์ง</span></a>
<a class="star_empty"><span class="ir">๋ณ ๋น์์ง</span></a>
<a class="star_empty"><span class="ir">๋ณ ๋น์์ง</span></a>
</span>
</div>
</div>
<hr>
<button class="more">
<a href="#">์์ธํ ๋ณด๊ธฐ</a>
</button>
</div>
</article>
<article class="card">
<div class="card__body">
<p class="desc">
๋ด๊ฐ ์ฌ๊ณ์ ์ค ๊ฐ์ฅ ์ข์ํ๋ ๊ณ์ ์ด ์จ๋ค. ๋ฎ์ด ๊ธด ๊ฒ์ ๋ณ๋ก ์ข์ํ์ง ์๋ ๋์๊ฒ ์ผ์กฐ๋์ด ๋ฎ์์ง๊ณ ๋ฎ์ ๊ธธ์ด๊ฐ ์งง์์ ธ๊ฐ๋ ์ด ์๊ธฐ๋ ์์ ๊ฐ์ ์๊ฒจ์ค๋ค. ๋ฌด์๋ณด๋ค ๊ทธ ์
๋ชฝ๊ฐ์ ๋์๊ฐ ๋๋ฌ๋ค๋ ๊ฒ์ ๋ํ ์๋๊ฐ๋ ํฌ๋ค. ์๋ฌดํผ ๊ณง ์ฌ ๊ฐ์์ ํ์ํ๋คโบ
</p>
<hr>
<div class="profile">
<span id="card__icon" class="icon__logo2" aria-hidden="์ต๊ฐ์">
<a href="#" class="link2"><span class="ir">์ต๊ฐ์</span></a>
</span>
<div class="user__name">
<h2>์ต๊ฐ์</h2>
<p>@autumn_lover</p>
<span id="star">
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
</span>
</div>
</div>
<hr>
<button class="more">
<a href="#">์์ธํ ๋ณด๊ธฐ</a>
</button>
</div>
</article>
<article class="card">
<div class="card__body">
<p class="desc">
๊ฐ์์ ๋
์์ ๊ณ์ ์ด์ง์. ํ์ง๋ง ์์ฆ ๋ฐ๋น ์ ์ฑ
์ฝ์ ์๊ฐ์ด ์๋ค์. ์จ๋ ์ ๋ ๊ฐ์์ด ์ข์ต๋๋ค. ์์ ๋ถ์ฒ๋ผ ์ ๋ ๋น์ผ์ธ์ด๋ผ์ ์์ ํ ์ฌ๋ํ ์ ์๋ ์ ์ฆ์ ๊ณ์ ์ด์ง๋ง์โฆ๐ ๊ฒจ์ธ ํนํ๊ณผ ์ฌ๋ฆ ํน์๋ฅผ ๋ชป๊ฒฌ๋ ์ ๋๋ก ์ซ์ดํด์์ผ๊น์? ใ
ใ
</p>
<hr>
<div class="profile">
<span id="card__icon" class="icon__logo3" aria-hidden="์ด๋ก๋ก">
<a href="#" class="link3"><span class="ir">์ด๋ก๋ก</span></a>
</span>
<div class="user__name">
<h2>์ด๋ก๋ก</h2>
<p>@lee_tt</p>
<span id="star">
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_fill"><span class="ir">๋ณ ์ฑ์์ง</span></a>
<a class="star_empty"><span class="ir">๋ณ ๋น์์ง</span></a>
</span>
</div>
</div>
<hr>
<button class="more">
<a href="#">์์ธํ ๋ณด๊ธฐ</a>
</button>
</div>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์ ๋ถํฐ ์์ํ๋ค. ์์ด์ฝ ์ถ๋ ฅ์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ์ IR ํจ๊ณผ๋ฅผ ์ ๊ทน ํ์ฉํ๋๋ก ํ๋ค. ์์ธํ ์ค๋ช ์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<style>
/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gmarket {
font-family: 'GmarketSans';
font-weight: 400;
}
/* reset */
* {
margin: 0;
padding: 0;
}
body {
background-color: #FDF6F6;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
color: #fff;
}
img {
width: 100%; /* ์ด๋ฏธ์ง ํ์ด๋์จ ๊ฑฐ ์ง์ด๋ฃ๊ธฐ */
}
hr {
margin: 30px 0;
}
button {
border: none;
font-family: 'GmarketSans';
cursor: pointer;
}
/* common */
.container {
width: 1160px;
padding: 0 20px;
margin: 20px auto;
min-width: 1160px; /* ๋ฐ์ํ ํ ๋ ์์ ์ค ๊ฒ */
}
.section {
padding: 120px 0;
}
.section > h2 {
font-size: 50px;
line-height: 1;
text-align: center;
margin-bottom: 30px;
}
.section > p {
font-size: 24px;
text-align: center;
margin-bottom: 70px;
font-weight: 500;
color: #666;
}
/* cardType */
.card__inner {
display: flex;
justify-content: space-between; /* ๊ฐ๊ฒฉ ๋จ์ด๋จ๋ฆฌ๊ธฐ */
}
.card {
width: 33%;
background: #fff;
border-radius: 10px;
margin-right: 20px;
}
#card__icon {
width: 60px;
height: 60px;
display: block;
border-radius: 100%;
margin-right: 10px;
}
/* ์์ด์ฝ ํ๋ํ๋์ ์๊น ๋ฃ์ด์ฃผ๊ธฐ */
.icon__logo1 {
background-color: #fceceb;
}
.icon__logo2 {
background-color: #ecfceb;
}
.icon__logo3 {
background-color: #fcebfb;
}
.card__body {
padding: 30px;
}
.card__body .title {
font-size: 24px;
margin-bottom: 10px;
font-weight: 500;
/* ํ ์ค ํจ๊ณผ */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 30px; /* ์ ๋ชฉ ๊ธธ์ด์ ธ๋ ํ ์ค ์ ์ง */
}
.card__body .desc {
font-size: 20px;
font-weight: 500;
line-height: 1.4;
/* 7์คํจ๊ณผ : ๊ธ์ด ๋์ณ๋ 7์ค์ ๋์ง ์๋๋ก ํด์ค */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 7; /* 7์ค๊น์ง ์ ํ */
-webkit-box-orient: vertical;
}
.card__body .more {
margin: 0 82px;
font-size: 18px;
font-weight: 500;
color: #fff;
border-radius: 17px;
background-color: #e1a39f;
padding: 8px 25px;
}
.profile {
display: flex;
}
.user__name > h2 {
font-size: 28px;
font-weight: 500;
position: relative;
}
.user__name > p {
font-size: 18px;
font-weight: 300;
position: absolute;
top: 592px;
padding-left: 90px;
font-size: 16px;
font-weight: 300;
color: #666;
}
/* ir ํจ๊ณผ (์ด๋ฏธ์ง ๋์ฒด ํจ๊ณผ == alt) */
/* ํ๋ฉด์์์๋ ์๋์ค๊ฒ ํจ๊ณผ ๋์์ ์คํฌ๋ฆฐ๋ฆฌ๋๊ธฐ์๋ ์ฝํ๊ฒ ํ๋ ์์
*/
.ir {
display: block;
overflow: hidden;
font-size: 0;
line-height: 0;
text-indent: -9999px;
}
/* ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ */
/* ์์ด์ฝ 5๊ฐ๋ฅผ ์ด์ด ๋ง๋ ํ๋ ์์ SVG๋ก ์ถ์ถํ์ฌ ๊ทธ ์ขํ๊ฐ์ ์๋์ ๊ฐ์ด
์ฎ๊ฒจ๊ฐ๋ฉฐ ์์ด์ฝ ํ๋์ฉ ๋ณด์ด๋๋ก ํ๋ ๊ธฐ๋ฒ */
#card__icon a {
width: 30px;
height: 30px;
display: block;
background: url(img/textType_icon03.svg);
padding: 15px;
}
/* nth-child๊ฐ ๋จนํ์ง ์์ผ๋ a์ ํด๋์ค๊ฐ์ link1, link2... ์ด๋ฐ์์ผ๋ก ๋ฐ๊พธ์ */
#card__icon a.link1 {
background-position: 0px 0;
}
#card__icon a.link2 {
background-position: -80px 0;
}
#card__icon a.link3 {
background-position: -160px 0;
}
/* ๋ณ์ */
#star a {
width: 14px;
height: 14px;
display: inline-block;
}
#star > .star_fill {
background: url(img/star.svg);
}
#star > .star_empty {
background: url(img/star_empty.svg);
}
</style>
์ต์ข ๊ฒฐ๊ณผ
'Site' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ์ด๋ฏธ์ง/ํ ์คํธ ์ ํ 01 (8) | 2022.09.01 |
---|---|
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ํค๋ ์ ํ 01 (4) | 2022.09.01 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ํ ์คํธ ์ ํ 02 (3) | 2022.09.01 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ํ ์คํธ ์ ํ 01 (3) | 2022.08.30 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ์ด๋ฏธ์ง ์ ํ 03 - ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ & IRํจ๊ณผ ํ์ฉํ๊ธฐ (6) | 2022.08.20 |
๋๊ธ