์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ 01
์ด๋ฒ ํฌ์คํ ์์๋ Figma์์ ๋ง๋ ์ด๋ฏธ์ง ์ ํ ์น์ ์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์ ์ ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์.
์ด๋ฒ์ ๋ง๋ค ์น ์ฌ์ดํธ์ ์ ํ์ ์ด๋ฏธ์ง ์์ ์ ๋ชฉ๊ณผ ๋ณธ๋ฌธ(์ค๋ช
), ๋ฒํผ์ ์ฌ๋ ค๋๋ ๊ฐ๋จํ ๋ฐฉ์์ด๋ค.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๊ณ , ์ด๋ฏธ์ง๋ img ํ๊ทธ๊ฐ ์๋ article ํ๊ทธ์ CSS๋ก ๋์ค์ ์ถ๊ฐํด์ค ๊ฒ.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="imageType01" class="image__wrap nexon section">
<h1>๋ณ๋น ์ ๋นต๊ต์ค ๊ฐ๊ฐ์์๐</h1>
<p>๋ณ๋น ์ ๋นต๊ต์ค์ด 2022๋
8์ 23์ผ ๊ฐ๊ฐํฉ๋๋ค. ์๊ฐ์ ์ฒญ ๊ธฐํ๋ ์ง๊ธ ๋ฟ์ด๋ ์๋๋ฅด์ธ์!</p>
<div class="image__inner container">
<article class="image img1">
<h3 class="image__title">๋๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค</h3>
<p class="image__desc">
์์ ๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค๋ฅผ ๋ง๋ค ์ ์๋๋ก ๋๊ฒ ์ต๋๋ค.
์ด์ฌํ๋ง ํ๋ค๋ฉด ์์ ์๋ฃํ ๋ ์ฆ์์๋ ๋น์ ๋ ํ๋ฅญํ ์ ๋นต์ฌ!
</p>
<a class="image__btn" href="/" title="์์ธํ ๋ณด๊ธฐ">
์์ธํ ๋ณด๊ธฐ
</a>
</article>
<article class="image img2">
<h3 class="image__title">๋๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค</h3>
<p class="image__desc">
์์ ๋ง์ ์ ๋นต ํฌํธํด๋ฆฌ์ค๋ฅผ ๋ง๋ค ์ ์๋๋ก ๋๊ฒ ์ต๋๋ค.
์ด์ฌํ๋ง ํ๋ค๋ฉด ์์ ์๋ฃํ ๋ ์ฆ์์๋ ๋น์ ๋ ํ๋ฅญํ ์ ๋นต์ฌ!
</p>
<a class="image__btn" href="/" title="์์ธํ ๋ณด๊ธฐ">
์์ธํ ๋ณด๊ธฐ
</a>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์
๋ถํฐ ์์ํ๋ค.
๋ํ, HTML์์ ์ถ๊ฐํ์ง ์์๋ ์ด๋ฏธ์ง๋ฅผ background: url() ํ์์ผ๋ก ์ถ๊ฐํ๋ค.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<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;
min-width: 1160px; /* ๋ฐ์ํ ํ ๋ ์์ ์ค ๊ฒ */
}
.section {
padding: 120px 0;
}
.section > h1 {
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;
}
/* imageType */
.image__inner {
display: flex;
justify-content: space-between; /* ๊ฐ๊ฒฉ ๋จ์ด๋จ๋ฆฌ๊ธฐ */
}
.image {
width: 49%;
height: 370px;
padding: 200px 30px 30px 30px;
color: #fff;
box-sizing: border-box;
}
.image.img1 {
background: url(img/imageType01_bg01.jpg) no-repeat center;
}
.image.img2 {
background: url(img/imageType01_bg02.jpg) no-repeat center;
}
.image__title {
font-size: 32px;
margin-bottom: 10px;
}
.image__desc {
font-size: 16px;
line-height: 1.5;
margin-bottom: 10px;
font-weight: 300;
/* 2์คํจ๊ณผ : ๊ธ์ด ๋์ณ๋ 2์ค์ ๋์ง ์๋๋ก ํด์ค */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
padding-right: 30px;
}
.image__btn {
background-color: rgba(96, 52, 0, 0.8);
padding: 10px 15px;
font-size: 16px;
font-weight: 300;
color: #fff;
display: inline-block;
}
</style>
๋๊ธ