์ฌ์ดํธ ๋ง๋ค๊ธฐ : ํ ์คํธ ์ ํ STUDY 01
์ด๋ฒ ํฌ์คํ
์์๋ Figma์์ ๋ง๋ ํ
์คํธ ์ ํ ์น์
์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์
์
ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
์์ด์ฝ ์ถ๋ ฅ์ ์์ด์ฝ์ด ๋ค์ด๊ฐ ์์ ๋จผ์ ์ฝ๋ฉ์ผ๋ก ๋ง๋ค์ด ๋ธ ํ, ์์ด์ฝ์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ๊ธฐ๋ฒ์ผ๋ก ์ ์์ ๋ฃ๋ ์์ผ๋ก ์ฝ๋ฉ์
์งํํ์์ต๋๋ค.
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์. ๊ทธ์ ๋์์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ์ฉ ์์ด์ฝ SVG๋ฅผ ์ถ๋ ฅํ ํ์ด์ง๋ ๋ฐ๋ก ๋ง๋ค๋๋ก ํ๋ค. ๋ง๋๋ ๋ฐฉ๋ฒ์ ์ง๋ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ํฌ์คํ ์ ์ฐธ์กฐํ ๊ฒ.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๋๋ก ํ์. img ํ๊ทธ์ alt์ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์ํด ์์ด์ฝ์ด ๋ค์ด๊ฐ span ํ๊ทธ์ ํด๋์ค ๊ฐ์ "ir"๋ก ์ค์ ํ์. ์์ธํ ์ค๋ช ์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="cardType01" class="card__wrap nexon section">
<p>ํ
์คํธ ์ ํ 01</p>
<h2>์๋ฐ์คํฌ๋ฆฝํธ์ ๋ํด ๋ถ์ํ์</h2>
<div class="card__inner container">
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo1" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link1"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">๋ถ์ํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo2" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link2"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">๋ฆฌ์์นํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo3" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link3"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">์กฐ์ฌํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
</div>
<div class="card__inner container">
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo4" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link4"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">๋ฆฌ์์นํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo5" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link5"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">๋ถ์ํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
<article class="card">
<div class="card__body">
<span id="card__icon" class="icon__logo6" aria-hidden="๋ถ์ํ๊ธฐ">
<a href="#" class="link6"><span class="ir">๋ถ์ํ๊ธฐ</span></a>
</span>
<h3 class="title">์ ์ํ๊ธฐ</h3>
<p class="desc">
์๋ฐ์คํฌ๋ฆฝํธ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ฅผ ํตํด ์ด์ฉ๊ตฌ์ ์ฉ๊ตฌ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ์ฌ๋ด์ฌ๋ผ ์ฌ๋ด์ฌ๋ผ ๋ถ์ํฉ์๋ค.
</p>
<a href="#" class="more">
๋ ๋ณด๊ธฐ
</a>
</div>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์ ๋ถํฐ ์์ํ๋ค. ์์ด์ฝ ์ถ๋ ฅ์ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ์ IR ํจ๊ณผ๋ฅผ ์ ๊ทน ํ์ฉํ๋๋ก ํ๋ค. ์์ธํ ์ค๋ช ์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<style>
/* fonts */
@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');
.nexon {
font-family: 'NexonLv1Gothic';
font-weight: 400;
}
/* reset */
* {
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 100%; /* ์ด๋ฏธ์ง ํ์ด๋์จ ๊ฑฐ ์ง์ด๋ฃ๊ธฐ */
}
/* 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: 70px;
}
.section > p {
font-size: 16px;
text-align: center;
margin-bottom: 10px;
}
/* cardType */
.card__inner {
display: flex;
justify-content: space-between; /* ๊ฐ๊ฒฉ ๋จ์ด๋จ๋ฆฌ๊ธฐ */
}
.card {
width: 32%;
background: #f5f5f5;
}
#card__icon {
width: 60px;
height: 60px;
display: block;
border-radius: 100%;
margin-bottom: 10px;
}
/* ์์ด์ฝ ํ๋ํ๋์ ์๊น ๋ฃ์ด์ฃผ๊ธฐ */
.icon__logo1 {
background-color: #ff8383;
}
.icon__logo2 {
background-color: #ffbe83;
}
.icon__logo3 {
background-color: #b2e295;
}
.icon__logo4 {
background-color: #83b4ff;
}
.icon__logo5 {
background-color: #d083ff;
}
.icon__logo6 {
background-color: #83d7cd;
}
.card__body {
padding: 20px;
}
.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: 18px;
font-weight: 300;
line-height: 1.4;
padding-bottom: 20px;
color: #666;
margin-bottom: 20px;
/* 4์คํจ๊ณผ : ๊ธ์ด ๋์ณ๋ 4์ค์ ๋์ง ์๋๋ก ํด์ค */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4; /* 4์ค๊น์ง ์ ํ */
-webkit-box-orient: vertical;
}
.card__body .more {
font-size: 18px;
font-weight: 300;
color: #666;
margin-bottom: 20px;
text-decoration: underline;
}
/* ir ํจ๊ณผ (์ด๋ฏธ์ง ๋์ฒด ํจ๊ณผ == alt) */
/* ํ๋ฉด์์์๋ ์๋์ค๊ฒ ํจ๊ณผ ๋์์ ์คํฌ๋ฆฐ๋ฆฌ๋๊ธฐ์๋ ์ฝํ๊ฒ ํ๋ ์์
*/
.ir {
display: block;
overflow: hidden;
font-size: 0;
line-height: 0;
text-indent: -9999px;
}
/* ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ */
/* ์์ด์ฝ ์ฌ๋ฌ๊ฐ๋ฅผ ์ด์ด ๋ง๋ ํ๋ ์์ SVG๋ก ์ถ์ถํ์ฌ ๊ทธ ์ขํ๊ฐ์ ์๋์ ๊ฐ์ด
์ฎ๊ฒจ๊ฐ๋ฉฐ ์์ด์ฝ ํ๋์ฉ ๋ณด์ด๋๋ก ํ๋ ๊ธฐ๋ฒ */
#card__icon a {
width: 30px;
height: 30px;
display: block;
background: url(img/textType_icon01.svg); /*๋ง๋ค์ด๋์ ์ด๋ฏธ์ง์คํ๋ผ์ดํธ์ฉ 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;
}
#card__icon a.link4 {
background-position: -240px 0;
}
#card__icon a.link5 {
background-position: -320px 0;
}
#card__icon a.link6 {
background-position: -400px 0;
}
</style>
๋๊ธ