์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์นด๋ ์ ํ
์ด๋ฒ ํฌ์คํ
์์๋ Figma์์ ๋ง๋ ์นด๋ ์ ํ ์น์
์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์
์
ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
์ต๋ํ ์น ํ์ค์ ์ค์ํ๊ธฐ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ฌ์ฉํ๊ณ ์ด๋ฏธ์ง ์ถ๋ ฅ ์ figure ํ๊ทธ๋ก ๊ฐ์ธ๋ฉฐ,
img ํ๊ทธ์์ alt(์ค๋ช
)์นธ์ ๋ถ์ฐ ์ค๋ช
์ ๋ฃ๋ ๋ฑ์ ์์
์ ์์ง ๋ง๋๋ก ํฉ์๋ค!
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์.
์ด๋ฒ์ ๋ง๋ค ์น ์ฌ์ดํธ์ ์ ํ์ ์นด๋ ์ ํ ์น์
์ด๋ค.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๊ณ img ํ๊ทธ์์์ alt ๊ธฐ๋ฅ๋ ์ ๊ทน ํ์ฉํ ๊ฒ.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="cardType" class="card__wrap nexon section">
<h2>๋ณ๋น ์ ๋นต๊ต์ค ๊ฐ๊ฐ์์๐</h2>
<p>๋ณ๋น ์ ๋นต๊ต์ค์ด 2022๋
8์ 23์ผ ๊ฐ๊ฐํฉ๋๋ค. ์๊ฐ์ ์ฒญ ๊ธฐํ๋ ์ง๊ธ ๋ฟ์ด๋ ์๋๋ฅด์ธ์!</p>
<div class="card__inner container">
<article class="card">
<!-- ์ด๋ฏธ์ง ๋ฃ์ ๋ ๊ทธ๋ฅ imgํ๊ทธ ์ฐ์ง๋ง๊ณ figure ํ๊ทธ ์์ ๋ฃ์ด์ ์จ์ผ ์นํ์ค ์ค์ํ๊ฑฐ์ -->
<figure class="card__header">
<img src="img/card_bg01.jpg" alt="์ ๋นต ๊ธฐ์ด ๊ฐ์">
</figure>
<div class="card__body">
<h3 class="title">์ ๋นต ๊ธฐ์ด ๊ฐ์</h3>
<p class="desc">
์ ๋นต์ ๊ธฐ์ด๊ฐ ๋๋ ๊ฐ์์
๋๋ค. ์ด์ฌ์๋ ์ดํดํ๊ธฐ ์ฝ๊ฒ ๊ฐ์๊ฐ ์งํ๋๋ฉฐ
์ด๋ฐ์๋ ์ด๋ก ๊ฐ์๋ถํฐ ์์ํด ์ค๋ฐ๋ถํฐ๋ ์ค์ต์ ์์ํ์ฌ ์ ๋นต์ ๊ธฐ์ด๋ฅผ ์ตํ๋๋ก ํฉ๋๋ค.
</p>
<a class="btn" href="/">๋ ์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
<article class="card">
<figure class="card__header">
<img src="img/card_bg02.jpg" alt="์ ๋นต ์ฌํ ๊ณผ์ ">
</figure>
<div class="card__body">
<h3 class="title">์ ๋นต ์ฌํ ๊ณผ์ </h3>
<p class="desc">
์ด์ ๊ธฐ์ด ๊ฐ์๊ฐ ๋๋ฌด ์ฌ์ ์์ํ๋ค๊ณ ๋๊ปด์ง ์ฆ์ ์ฌํ๊ณผ์ ์ ๋ค์ด๊ฐ๊ฒ ๋ ๊ฒ๋๋ค.
์์ค์ ํ๋งค๋๊ณ ์๋ ์ ๊ณผ์ ๋นต๋ค์ ์ง์ ๋ง๋ค์ด๋ณด๋ ์๊ฐ์ ๊ฐ๊ฒ ๋ฉ๋๋ค.
</p>
<a class="btn" href="/">๋ ์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
<article class="card">
<figure class="card__header">
<img src="img/card_bg03.jpg" alt="๋๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค ๋ง๋ค๊ธฐ">
</figure>
<div class="card__body">
<h3 class="title">๋๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค ๋ง๋ค๊ธฐ</h3>
<p class="desc">
์ด์ ๋นต์ง ์ฐฝ์
ํด๋ ๋ฌธ์ ์์ ์ ๋์ ์ค๋ ฅ์ ๊ฐ์ถ๊ฒ ๋์
จ์ ๊ฒ๋๋ค! ์ด์ ๋ ๋ฅ์ํด์ง ์ ๋นต ์ค๋ ฅ์
๋๋ง์ ๊ฐ์ฑ์ ๋ํ์ฌ ํผํผํ ํฌํธํด๋ฆฌ์ค๋ฅผ ๋ง๋ค์ด๋ณด์์!
</p>
<a class="btn" href="/">๋ ์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์
๋ถํฐ ์์ํ๋ค.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<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: 0 auto;
}
.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;
text-align: center;
margin-bottom: 70px;
color: #666;
}
/* cardType */
.card__inner {
display: flex;
justify-content: space-between; /* ๊ฐ๊ฒฉ ๋จ์ด๋จ๋ฆฌ๊ธฐ */
}
.card {
width: 32%; /* ํฅํ ๋ฐ์ํ์ ์ํด ๋ฐฑ๋ถ์จ๋ก ์
๋ ฅ */
background: #f5f5f5;
}
.card__body {
padding: 24px;
}
.card__body .title {
font-size: 22px;
padding-bottom: 10px;
}
.card__body .desc {
font-size: 18px;
font-weight: 300;
line-height: 1.4;
padding-bottom: 20px;
color: #666;
}
.card__body .btn {
}
</style>
๋๊ธ