728x90
๋ฐ์ํ
โญ๏ธ ์ด๋ฏธ์ง ์ ํ 02 โญ๏ธ
01. ๋ ์ด์์ ๊ตฌ์ํ๊ธฐ
๋ ์ด์์์ ๊ตฌ์ํ ๋๋, ์ค์ผ์นํ๋ฉด์ ์ธ๋ถ ๋ด์ฉ์ ์ ๋ณด๊น์ง ๊ตฌ์ฒด์ ์ผ๋ก ๊ณํํฉ๋๋ค.
02. ์์(div) ๋ง๋ค๊ธฐ : <body>
section ์ ์๋ฉํฑ ๋งํฌ์
ํ๊ณ , id ๋ก ์ด๋ฆ์ ์ง์ด์ค๋๋ค.
์นด๋ ์์ 3๊ฐ(article)์ ๋ง๋ค๊ณ , ์ ๋ชฉ๊ณผ ๋ด์ฉ์ ์
๋ ฅํฉ๋๋ค.
์ค๊ฐ ์ค๊ฐ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ดํด๋ณด๋ฉฐ ์ ๋ง๋ค์ด์ง๊ณ ์๋์ง ํ์ธํ๋ ๊ณผ์ ์ด ํ์ํฉ๋๋ค.
<section id="imageType02" class="image__wrap gmarket section">
<h2>์ด ๋ฌ์ ์ปจ์
๋ชจ๋ธ ์ ์ </h2>
<p>์ด ๋ฌ์ ์ปจ์
๋ชจ๋ธ๋ก ์ ์ ๋์ ๋ถ๋ค์ ์๊ฐํฉ๋๋ค.</p>
<div class="image__inner container">
<article class="image img1">
<figure class="image__box ">
<img src="img/image_bg02_01.jpg" alt="๋ฒ ์ํด">
</figure>
<div class="image__desc">
<h3>์ปจ์
29๊ธฐ ๋ฒ ์ํด</h3>
<a href="/" class="more" title="์์ธํ๋ณด๊ธฐ">์์ธํ๋ณด๊ธฐ</a>
</div>
</article>
<article class="image img2">
<figure class="image__box">
<img src="img/image_bg02_02.jpg" alt="๋ก์ฆ๋ฌธ">
</figure>
<div class="image__desc">
<h3>์ปจ์
29๊ธฐ ๋ก์ฆ๋ฌธ</h3>
<a href="/" class="more" title="์์ธํ๋ณด๊ธฐ">์์ธํ๋ณด๊ธฐ</a>
</div>
</article>
<article class="image img3">
<figure class="image__box">
<img src="img/image_bg02_03.jpg" alt="์์ผ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>์ปจ์
29๊ธฐ ์์ผ๋ฆฌ</h3>
<a href="/" class="more" title="์์ธํ๋ณด๊ธฐ">์์ธํ๋ณด๊ธฐ</a>
</div>
</article>
</div>
</section>
02. style(css) ์ค์ ํ๊ธฐ : <style>
/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gmarket {
font-family: 'GmarketSans';
font-weight: 300;
}
/* reset */
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 100%;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
/* common */
.container {
width: 1160px;
padding: 0 20px;
margin: 0 auto;
min-width: 1160;
}
.section {
padding: 120px 0;
}
.section > h2 {
font-size: 50px;
line-height: 1;
text-align: center;
margin-bottom: 20px;
}
.section > p {
font-size: 22px;
color: #666;
text-align: center;
margin-bottom: 70px;
}
/* imageType02 */
.image__wrap {}
.image__inner {
display: flex;
justify-content: space-between;
}
.image {
width: 32%;
height: 520px;
box-sizing: border-box;
position: relative;
overflow: hidden;
}
/* .image.img1 {
background: url(img/image_bg02_01.jpg) no-repeat center / cover ;
}
.image.img2 {
background: url(img/image_bg02_02.jpg) no-repeat center / cover ;
}
.image.img3 {
background: url(img/image_bg02_03.jpg) no-repeat center / cover ;
} */
.image__box {}
.image__box img {
/* vertical-align: top; ์ด๋ฏธ์ง ์ฌ๋ฐฑ ์์ ๊ธฐ */
}
.image__desc {
position: absolute;
left: 0;
bottom: -100px;
width: 100%;
text-align: center;
backdrop-filter: blur(10px); /* ํฌ๋ช
๋ ์ค์ */
padding: 23px 20px;
box-sizing: border-box;
background-color: rgba(0,0,0,0.3);
transition: all 0.3s ease-in-out;
}
.image:hover .image__desc {
bottom: 0;
}
.image:hover .image__box img {
transform: scale(1.05); /* ๋ง์ฐ์ค๋ฅผ ๊ฐ๊น์ดํ๋ฉด ํฌ๊ฒ */
transition: all 0.6s ease-in-out; /* ํฌ๊ธฐ ๋ณํ์ ์๋ */
}
.img1 .image__desc {background: rgba(167, 171, 235, 0.5);}
.img2 .image__desc {background: rgba(244, 206, 131 ,0.5);}
.img3 .image__desc {background: rgba(24, 35, 56 ,0.5);}
.img1 .image__desc h3 {color: #000;}
.img2 .image__desc h3 {color: #000;}
.img3 .image__desc h3 {color: #fff;}
.img1 .image__desc .more {color: #000;}
.img2 .image__desc .more {color: #000;}
.img3 .image__desc .more {color: #fff;}
.image__desc h3 {
font-size: 24px;
margin: 5px;
}
.image__desc .more {
font-size: 16px;
}
.image__desc .more:hover {
text-decoration: underline;
}
03. ๊ฒฐ๊ณผ๋ณด๊ธฐ
728x90
๋ฐ์ํ
'CSS > Layout_Site' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ํ ์คํธ ์ ํ (1) (2) | 2022.09.01 |
---|---|
์ด๋ฏธ์ง ์ ํ (3) (2) | 2022.08.22 |
์ด๋ฏธ์ง ์ ํ (1) (4) | 2022.08.17 |
์นด๋ ์ ํ (3) (8) | 2022.08.11 |
์นด๋ ์ ํ (2) (7) | 2022.08.10 |
๋๊ธ