์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์นด๋ ์ ํ 03
์ด๋ฒ ํฌ์คํ
์์๋ Figma์์ ๋ง๋ ์นด๋ ์ ํ ์น์
์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์
์
ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
์ต๋ํ ์น ํ์ค์ ์ค์ํ๊ธฐ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ฌ์ฉํ๊ณ ์ด๋ฏธ์ง ์ถ๋ ฅ ์ figure ํ๊ทธ๋ก ๊ฐ์ธ๋ฉฐ,
img ํ๊ทธ์์ alt(์ค๋ช
)์นธ์ ๋ถ์ฐ ์ค๋ช
์ ๋ฃ๋ ๋ฑ์ ์์
์ ์์ง ๋ง๋๋ก ํฉ์๋ค!
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์.
์ด๋ฒ์ ๋ง๋ค ์น ์ฌ์ดํธ์ ์ ํ์ ์นด๋ ์ ํ ์น์
์ฌํํธ์ด๋ฉฐ ์ง๋ ๋ฒ ์นด๋ ์ ํ์ด ์ง๋ผ๋ฉด ์ํ๋ง์ด๋ผ๋ฉด ์ด๋ฒ ํธ์ ๋ถ๋ญ, ๋ง๋ผ๋ง์ด๋ ๊ฐ์คํ์๐ฅต.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๊ณ img ํ๊ทธ์์์ alt ๊ธฐ๋ฅ๋ ์ ๊ทน ํ์ฉํ ๊ฒ.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="cardType03" class="card__wrap score section">
<h2 class="blind">ํฌํธํด๋ฆฌ์ค ๊ตฌ๊ฒฝํ๊ธฐ</h2> <!-- ์คํฌ๋ฆฐ๋ฆฌ๋๊ธฐ์๋ ์ฝํ๊ฒ ํ๋ ๊ฒ์ผ๋ก ์๋ณด์ด๊ฒ ํ๋ ค๋ฉด blind ์ฒ๋ฆฌํ๊ธฐ -->
<div class="card__inner container">
<article class="card">
<figure class="card__header">
<img src="img/card3_bg01.jpg" alt="๊น๋ฏผ์ฃผ์ ํฌํธํด๋ฆฌ์ค">
<figcaption># Editorial Design</figcaption>
</figure>
<div class="card__contents">
<h3>
๊น๋ฏผ์ฃผ์ ๊ฐ์ฑ ๋์น๋ ํฌํธํด๋ฆฌ์ค,<br>๊ฐ์ด ๊ตฌ๊ฒฝํ์ค๋์?
</h3>
<p>
์ํ์ ์์ ๋ฐ์๋ ์คํธ๋ ์ค๋ฅผ ๋ ๊ฐ์ฑ ์นดํ๋ฅผ ์ฐพ์๋ค๋๋ฉฐ ํ๋ ๋๋ ๊ฐ์ฑ ์์ด๋ ์ด ์ ์๋ ์ฌ๋์ด ๋์๊ณ
๊ทธ๋ ๊ฒ ๋๋ ๊ฐ์ฑ์ ์ธ ์ฌ์ง๋ค๋ง์ ์ฌ๋ฆฌ๋ ์ธ์คํ ๊ณ์ ์ ์์ฑํ๊ฒ ๋์๋ค.
</p>
</div>
<div class="card__footer">
<h4>Minju Kim <em>9 resources</em></h4>
<span><img src="img/card_bg03_icon01.png" alt="๊น๋ฏผ์ฃผ"></span>
</div>
</article>
<article class="card">
<figure class="card__header">
<img src="img/card3_bg02.jpg" alt="๋ฐ์ง์์ ํฌํธํด๋ฆฌ์ค">
<figcaption># Front-End</figcaption>
</figure>
<div class="card__contents">
<h3>
์ฝ๋ฉ์ฒ์ฌ ๋ฐ์ง์์ ํฌํธํด๋ฆฌ์ค,<br>
ํ ๋ฒ ๋ณผ๋?๐
</h3>
<p>
์ด๋ฆฐ ์์ ๋ถํฐ ๋ ์ด๊ณผ ๋จธ๋ฆฌ์๋ค. ํ์ฐฝ์์ 12๋
๋์ ๋จ ํ ๋ฒ๋ ์ํ์ ํฌ๊ธฐํ ์ ์ด ์์์ผ๋ฉฐ ๊ทธ๋ฐ ๋์๊ฒ ์ฝ๋ฉ์ด๋
๋๋ฌด๋๋ ์ฆ๊ฑฐ์ด ์ทจ๋ฏธํ๋์ด์์ผ๋ฉฐ ์์ฐ์ค๋ฝ๊ฒ ๊ฐ๋ฐ์๋ฅผ ๊ฟ๊พธ๊ฒ ๋์๋ค.
</p>
</div>
<div class="card__footer">
<h4>Jisu Park <em>8 resources</em></h4>
<span><img src="img/card_bg03_icon02.png" alt="๋ฐ์ง์"></span>
</div>
</article>
<article class="card">
<figure class="card__header">
<img src="img/card3_bg03.jpg" alt="ํ๋ฏผ์ฒ ์ ํฌํธํด๋ฆฌ์ค">
<figcaption># 3D Artist</figcaption>
</figure>
<div class="card__contents">
<h3>
3D ์ํฐ์คํธ๊ฐ ๋๊ณ ์ถ์ ํ๋ฏผ์ฒ ์<br>
ํฌํธํด๋ฆฌ์ค, ๋ด ์ฃผ์ธ์๐
</h3>
<p>
C4D๋ฅผ ์ฒ์ ๋ฐฐ์ด ๊ทธ ์๊ฐ ๋๋ ๊ฒฐ์ฌํ๋ค. ๋ฐ๋์ 3D ๊ทธ๋ํฝ์ ์ ๊ณตํ๊ฒ ๋ค๊ณ ๋ง์ด๋ค. ๋ ์ด ๋ถ์ผ์ ์ํฐ์คํธ๋ก
์ฑ๊ณตํด ๋๋ฐฉ์์ ์๋ ๊ฒ์ ๋ชฉํ๋ก ์์ผ๋ก ๋์๊ฐ ๊ฒ์ด๋ค.
</p>
</div>
<div class="card__footer">
<h4>Mincheol Han <em>7 resources</em></h4>
<span><img src="img/card_bg03_icon03.png" alt="ํ๋ฏผ์ฒ "></span>
</div>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์
๋ถํฐ ์์ํ๋ค.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<style>
/* fonts */
@import url('https://webfontworld.github.io/score/SCoreDream.css');
.score {
font-family: 'SCoreDream';
font-weight: 300;
}
/* 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; /* 1200px์์ ์ข์ฐ๋ก 20px ํจ๋ฉ๊ฐ ์ค๊ฑฐ ๋นผ์ 1160px */
padding: 0 20px;
margin: 0 auto;
min-width: 1160px;
}
.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;
}
/* ์คํฌ๋ฆฐ๋ฆฌ๋๊ธฐ์๋ ์ฝํ๊ฒ ํ๋ ๊ฒ์ผ๋ก ์๋ณด์ด๊ฒ
ํ๊ณ ์ ํ๋ ์์ฑ์ 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.333%;
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; /* figcaption์ ๊ณ ์ ํ ์์น */
}
.card__header img {
border-radius: 10px;
box-shadow: 4px 4px 5px 0 rgba(0, 0, 0, 0.05);
margin-bottom: 20px;
}
.card__header figcaption {
padding: 6px 16px;
border-radius: 50px;
background-color: #fff;
position: absolute; /* ์์น๋ฅผ card__header์ชฝ์ผ๋ก ์ฎ๊น */
right: 10px;
top: 10px;
text-align: center;
font-size: 14px;
color: #7b7b7b;
}
.card__contents h3 {
font-size: 20px;
line-height: 1.4;
margin-bottom: 10px;
/* 2์คํจ๊ณผ */
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;
margin-bottom: 30px;
/* 3์คํจ๊ณผ */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* ์นด๋ ํ๋จ ์ ์ ์ ๋ณด */
.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;
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);
}
</style>
๋๊ธ