๋ ์ด์์ : ์ด๋ฏธ์ง ์ ํ02
๋ค์๊ณผ ๊ฐ์ ์ด๋ฏธ์ง ์ ํ์ ๋ ์ด์์์ ์์ ํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ์ด๋ฒ์๋ ์ด๋ฏธ์ง๊ฐ ์ด ์ธ ๊ฐ์ด๋ฉฐ, ์ด๋ฏธ์ง ์์ ๋ง์ฐ์ค๋ฅผ hoverํ๋ฉด '์์ธํ ๋ณด๊ธฐ' ๋ฒํผ์ด ๋ํ๋๋ CSS ์์๋ ์ถ๊ฐํ์์ต๋๋ค.
HTML ์์ค
๋จผ์ , ์ธ ๊ฐ์ article ํ๊ทธ๋ฅผ ๋ง๋ค์ด ๊ฐ๊ฐ ์ด๋ฏธ์ง๋ฅผ ์ฒจ๋ถํด ์ฃผ์์ต๋๋ค. article ํ๊ทธ ์์์๋ image ๋ถ๋ถ๊ณผ desc ๋ถ๋ถ์ ๋๋์ด ์์ ํด ์ฃผ์์ต๋๋ค.
<section id="imageType02" class="card__wrap gmark section">
<h2>๋ฐ๋ค์ ์ฌ๋ ์๋ฌผ๋ค</h2>
<p>๋ฐ๋ค์๋ ์ด๋ค ์๋ฌผ๋ค์ด ์ด๊ณ ์์๊น์?</p>
<div class="image__inner container">
<article class="image img1">
<figure class="image__box">
<img src="img/img02_bg01.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>TTUNG-E</h3>
<a href="/" class="more" title="์์ธํ ๋ณด๊ธฐ">์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
<article class="image img2">
<figure class="image__box">
<img src="img/img02_bg02.jpg" alt="๋ฌธ์ด">
</figure>
<div class="image__desc">
<h3 class="white">JingJing-E</h3>
<a href="/" class="more white" title="์์ธํ ๋ณด๊ธฐ">์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
<article class="image img3">
<figure class="image__box">
<img src="img/img02_bg03.jpg" alt="๊ฒ">
</figure>
<div class="image__desc">
<h3>Jibgeo-Sajang</h3>
<a href="/" class="more" title="์์ธํ ๋ณด๊ธฐ">์์ธํ ๋ณด๊ธฐ</a>
</div>
</article>
</div>
</section>
CSS ์์ค
ํฐํธ๋ ์ง๋ง์ผ ์ฐ์ค๋ฅผ ์ฌ์ฉํ์๊ณ , display: flex๋ฅผ ์ด์ฉํ์ฌ ์ธ ๊ฐ์ ์ด๋ฏธ์ง๋ฅผ ๊ฐ๋ก๋ก ๋ฐฐ์นํ์์ต๋๋ค. overflow-hidden์ ์ด์ฉํ์ฌ desc ๋ฐ์ค๊ฐ ๋ณด์ด์ง ์๊ฒ ๋ง๋ค๊ณ , image์ ๋ง์ฐ์ค๊ฐ hover๋์์ ๋ image๊ฐ ์ ๋๋ฉ์ด์ ํจ๊ณผ๋ฅผ ๋ณด์ด๋ฉฐ ํ๋๋๊ณ , desc ๋ฐ์ค๊ฐ ์๋์์ ์๋ก ๋ํ๋๊ฒ๋ ์์ ํด ์ฃผ์์ต๋๋ค.
/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gmark {
font-family: 'GmarketSans';
font-weight: 500;
}
/* 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;
}
.section {
padding: 120px 0;
}
.section>h2 {
font-size: 50px;
line-height: 1;
text-align: center;
margin-bottom: 10px;
}
.section>p {
font-size: 22px;
font-weight: 300;
color: #666;
text-align: center;
margin-bottom: 70px;
}
/* imageType */
.image__inner {
display: flex;
justify-content: space-between;
}
.image {
width: 32%;
position: relative;
overflow: hidden;
}
.image__box img {
vertical-align: top;
height: 100%;
}
.image__desc {
position: absolute;
left: 0;
bottom: -100px;
transition: all 0.3s ease-in-out;
width: 100%;
text-align: center;
height: 100px;
backdrop-filter: blur(4px);
padding: 25px 20px;
box-sizing: border-box;
}
.img1 .image__desc {
background: rgba(190, 163, 112, 0.1);
}
.img2 .image__desc {
background: rgba(95, 35, 32, 0.1);
}
.img3 .image__desc {
background: rgba(142, 141, 141, 0.1);
}
.img1 .image__desc h3 {
color: white;
}
.img2 .image__desc h3 {
color: white;
}
.img1 .image__desc .more {
color: white;
}
.img2 .image__desc .more {
color: white;
}
.image:hover .image__desc {
bottom: 0px;
}
.image:hover .image__box img {
transform: scale(1.03);
transition: all 0.6s ease-in-out;
}
.image__desc h3 {
font-size: 24px;
margin-bottom: 5px;
}
.image__desc .more {
font-size: 16px;
font-weight: 200;
}
.image__desc .more:hover {
text-decoration: underline;
}
๊ฒฐ๊ณผ
'WebSite' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ํ ์คํธ ์ ํ ๋ ์ด์์01 (6) | 2022.08.30 |
---|---|
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ ๋ ์ด์์03 (11) | 2022.08.19 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ ๋ ์ด์์01 (4) | 2022.08.17 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์นด๋ ์ ํ ๋ ์ด์์03 (17) | 2022.08.10 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์นด๋ ์ ํ ๋ ์ด์์02 (12) | 2022.08.09 |
๋๊ธ