๋ ์ด์์ : ์ด๋ฏธ์ง ์ ํ03
๋ค์๊ณผ ๊ฐ์ ์ด๋ฏธ์ง ์ ํ์ ๋ ์ด์์์ ์์ ํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ์ด๋ฒ์๋ ์ด๋ฏธ์ง๊ฐ ์ด ๋ค์ฏ ๊ฐ์ด๋ฉฐ, ์ด๋ฏธ์ง ์์ ๋ง์ฐ์ค๋ฅผ hoverํ๋ฉด desc ๋ฐ์ค์ ์์ ์์ด์ฝ๋ค์ด ๋ํ๋๋ ์ ๋๋ฉ์ด์ ํจ๊ณผ๋ ์ถ๊ฐํด ์ฃผ์์ต๋๋ค.
HTML ์์ค
๋จผ์ , container-fluid๋ผ๋ ์ปค๋ค๋ ์ปจํ ์ด๋๋ฅผ ์์ ํด ์ฃผ์์ต๋๋ค. ์ปจํ ์ด๋ ์์๋ ๋ค์ฏ ๊ฐ์ article ํ๊ทธ๋ฅผ ๋ฃ์ด์ฃผ์์ต๋๋ค. ๊ฐ๊ฐ์ article ์์๋ ์ด๋ฏธ์ง์ ์ค๋ช , sns์ ํด๋นํ๋ div ๋ฐ์ค๋ฅผ ๋ง๋ค์ด ์ฃผ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ article์๋ ์ด๋ฏธ์ง๋ฅผ ๋ฐฑ๊ทธ๋ผ์ด๋ ๋ฐฉ์์ผ๋ก ์ฝ์ ํด ์ฃผ์์ต๋๋ค. ๊ทธ๋ฆฌ๋๋ก ๋ ์ด์์์ ์์ ํ๊ธฐ ๋๋ฌธ์, ์ด๋ฏธ์ง ๊นจ์ง์ ๋ฐฉ์งํ๊ธฐ ์ํด์์ ๋๋ค.
<section id="imageType03" class="card__wrap gowun section">
<h2>์ธ๊ณ 7๋ ๋ถ๊ฐ์ฌ๋ฆฌ</h2>
<p>๊ฒฝ์ด๋ก์ด ์ง๊ตฌ์์ 7๋ ๋ถ๊ฐ์ฌ๋ฆฌ๋ฅผ ์๊ฐํฉ๋๋ค.<br>
์๋์ ์ด๋ฏธ์ง๋ค์ ํด๋ฆญํด ๋ณด์ธ์.</p>
<div class="image__inner container-fluid">
<article class="image">
<!-- <figure class="image__box">
<img src="img/img03_bg01.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure> -->
<div class="image__desc">
<h3>Wow! Starfish</h3>
<p>unbelievable</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">ํ์ด์ค๋ถ</span></a>
<a href="#" class="link"><span class="ir">ํธ์ํฐ</span></a>
<a href="#" class="link"><span class="ir">์ธ์คํ๊ทธ๋จ</span></a>
<a href="#" class="link"><span class="ir">์ ํ๋ธ</span></a>
<a href="#" class="link"><span class="ir">๋งํฌ</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/img03_bg02.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>Wow! Starfish</h3>
<p>unbelievable</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">ํ์ด์ค๋ถ</span></a>
<a href="#" class="link"><span class="ir">ํธ์ํฐ</span></a>
<a href="#" class="link"><span class="ir">์ธ์คํ๊ทธ๋จ</span></a>
<a href="#" class="link"><span class="ir">์ ํ๋ธ</span></a>
<a href="#" class="link"><span class="ir">๋งํฌ</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/img03_bg03.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>Wow! Starfish</h3>
<p>unbelievable</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">ํ์ด์ค๋ถ</span></a>
<a href="#" class="link"><span class="ir">ํธ์ํฐ</span></a>
<a href="#" class="link"><span class="ir">์ธ์คํ๊ทธ๋จ</span></a>
<a href="#" class="link"><span class="ir">์ ํ๋ธ</span></a>
<a href="#" class="link"><span class="ir">๋งํฌ</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/img03_bg04.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>Wow! Starfish</h3>
<p>unbelievable</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">ํ์ด์ค๋ถ</span></a>
<a href="#" class="link"><span class="ir">ํธ์ํฐ</span></a>
<a href="#" class="link"><span class="ir">์ธ์คํ๊ทธ๋จ</span></a>
<a href="#" class="link"><span class="ir">์ ํ๋ธ</span></a>
<a href="#" class="link"><span class="ir">๋งํฌ</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/img03_bg05.jpg" alt="๋ถ๊ฐ์ฌ๋ฆฌ">
</figure>
<div class="image__desc">
<h3>Wow! Starfish</h3>
<p>unbelievable</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">ํ์ด์ค๋ถ</span></a>
<a href="#" class="link"><span class="ir">ํธ์ํฐ</span></a>
<a href="#" class="link"><span class="ir">์ธ์คํ๊ทธ๋จ</span></a>
<a href="#" class="link"><span class="ir">์ ํ๋ธ</span></a>
<a href="#" class="link"><span class="ir">๋งํฌ</span></a>
</div>
</article>
</div>
</section>
CSS ์์ค
ํฐํธ๋ ๊ณ ์ด ๋ฐํ์ ์ฌ์ฉํ์๊ณ , ์ด๋ฒ์๋ flex๊ฐ ์๋ grid๋ฅผ ํตํด ๋ ์ด์์์ ์์ ํด ์ฃผ์์ต๋๋ค. ๊ฐ๊ฐ์ ์์ด์ฝ์๋ ์น ํ์ค์ฑ์ ์ค์ํ ์ ์๋๋ก irํจ๊ณผ๋ฅผ ๋ฃ์ด์ฃผ์์ต๋๋ค. ์์ด์ฝ์ ์ฝ์ ํ ๋๋ ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ๊ธฐ๋ฒ์ ์ฌ์ฉํ์๋๋ฐ์, ๊ฒ์๊ธ ์๋จ์ ํผ๊ทธ๋ง์์ ์์ด์ฝ๋ค์ ์งํฉ ํ๋ ์์ ํ์ธํ ์ ์์ต๋๋ค. ํด๋น ํ๋ ์์ svg ํ์ผ๋ก ์ ์ฅํ ๋ค, background-position์ผ๋ก ์ด๋ฏธ์ง์ ์์น๋ฅผ ์กฐ์ ์์ผ ์์ฝ๊ฒ ์ด๋ฏธ์ง๋ฅผ ์ฝ์ ํ์์ต๋๋ค.
/* fonts */
@import url('https://webfontworld.github.io/yangheeryu/GowunBatang.css');
.gowun {
font-family: 'GowunBatang';
font-weight: 400;
}
/* reset */
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 100%;
vertical-align: top;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
}
.ir {
display: block;
overflow: hidden;
font-size: 0;
line-height: 0;
text-indent: -9999px;
}
/* common */
.container {
width: 1160px;
padding: 0 20px;
margin: 0 auto;
}
.container-fluid {
width: 100%;
padding: 0 100px;
box-sizing: border-box;
}
.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;
color: #666;
text-align: center;
margin-bottom: 70px;
}
/* imageType */
.image__inner {
display: grid;
grid-template-areas:
"box1 box1 box2 box3"
"box1 box1 box4 box5";
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-auto-rows: 1fr 1fr;
grid-gap: 20px;
}
.image {
position: relative;
overflow: hidden;
}
.image__inner .image:nth-child(1) {
grid-area: box1;
background: url(img/img03_bg01.jpg);
background-size: cover;
}
.image__inner .image:nth-child(2) {
grid-area: box2;
}
.image__inner .image:nth-child(3) {
grid-area: box3;
}
.image__inner .image:nth-child(4) {
grid-area: box4;
}
.image__inner .image:nth-child(5) {
grid-area: box5;
}
.image__desc {
position: absolute;
left: 0;
bottom: -100%;
width: 100%;
background-color: rgba(255,255,255,0.3);
backdrop-filter: blur(6px);
padding: 16px;
box-sizing: border-box;
transition: all 0.5s ease;
}
.image:hover .image__desc {
bottom:0;
}
.image:hover .image__sns {
right: 10px;
transition: all 0.4s ease;
}
.image__desc h3 {
font-size: 20px;
}
.image__desc p {
font-size: 16px;
color: #666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.image__sns {
position: absolute;
right: -100px;
top: 10px;
}
.image__sns a {
width: 36px;
height: 36px;
background: #fff;
border-radius: 50%;
display: block;
margin-bottom: 5px;
background: url(img/icon.svg) no-repeat;
}
/* ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ๊ธฐ๋ฒ */
.image__sns a:nth-child(2){
background-position: -50px 0;
}
.image__sns a:nth-child(3){
background-position: -100px 0;
}
.image__sns a:nth-child(4){
background-position: -150px 0;
}
.image__sns a:nth-child(5){
background-position: -200px 0;
}
๊ฒฐ๊ณผ
'WebSite' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ํ ์คํธ ์ ํ ๋ ์ด์์02 (5) | 2022.08.31 |
---|---|
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ํ ์คํธ ์ ํ ๋ ์ด์์01 (6) | 2022.08.30 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ ๋ ์ด์์02 (5) | 2022.08.17 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ ๋ ์ด์์01 (4) | 2022.08.17 |
์น์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์นด๋ ์ ํ ๋ ์ด์์03 (17) | 2022.08.10 |
๋๊ธ