
SliderType01
์นํ์ด์ง ์ค์ต์ ์ํ ์ฌ๋ผ์ด๋ ์ ํ์ ์ค์ตํด๋ณด๊ฒ ์ต๋๋ค! ์ด๋ฒ ์ฌ๋ผ์ด๋ ์ ํ์ ์ด๋ฏธ์ง์ ํ
์คํธ ์์ญ, ์์ด์ฝ์ด ํจ๊ป ๋ค์ด์๋ ํ์
์
๋๋ค.
๊ทธ๋ผ ์๋์ ์ฝ๋๋ฅผ ๋ณด๋ฉฐ ํจ๊ป ์ค์ต ํด๋ณด๊ฒ ์ต๋๋ค ~ ๐
< figma : ๋์์ธ ํ๊ธฐ >
์ด๋ฒ ์ ํ์ ์ฌ๋ผ์ด๋ ํ์ ์ผ๋ก ์ปจ์ ์ ๋ง๋ ๋ ์ด์์๊ณผ ๋์์ธ์ ์ค์ ํ์๋ฉด ๋ฉ๋๋ค. ์๋์ ํผ๊ทธ๋ง๋ฅผ ์ฐธ๊ณ ํ์ฌ HTML, CSS๋ฅผ ์ค์ ํด๋ด ์๋ค. ๐
< HTML ์์ค : ๋ ์์์ ๊ตฌ์กฐ ํ์ ํ๊ธฐ >
๋์์ธํ ์น ํ์ด์ง ์์์ ๋ณด๋ฉฐ ํ์ด์ง ๊ตฌ์กฐ๋ฅผ ํ์ ํ ํ ์น ํ์ค์ฑ๊ณผ ์ ๊ทผ์ฑ์ ๋ง๋์๋ฉํฑํ ๋งํฌ์ ์ ํด์ค๋๋ค.
TIP !
โข ์น์
, ์ํฐํด๊ณผ ๊ฐ์ ์๋ฉํฑ ํ๊ทธ์๋ ๊ผญ ํค๋ฉ ํ๊ทธ๋ฅผ ํจ๊ป ์ฌ์ฉํด์ฃผ์ด์ผ ์นํ์ค์ ์ค์ํ๊ฒ ๋ฉ๋๋ค.
โข ์น์
์์ญ์ ์นํ์ค ์ค์๋ฅผ ์ํด ์ ์ธํ h2ํ๊ทธ๊ฐ ์ฌ์ฉ์ ๋์ ๋ณด์ด์ง ์๋๋ก ๋ธ๋ผ์ธ๋ ์์ฑ์ ์ฃผ๊ธฐ ์ํด ์ ํ์๋ก ๋ธ๋ผ์ธ๋๋ฅผ ์ค์ ํฉ๋๋ค.
โข ์ด๋ฏธ์ง ๋์ฒด ํ
์คํธ๋ฅผ ๋์ ์๋ณด์ด๊ฒ ํ๊ธฐ ์ํด irํจ๊ณผ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
โข ์ด๋ฏธ์ง๋ css๋ก ๋ฃ๊ธฐ ๋๋ฌธ์ ์ด๋ฏธ์ง ์ ํ
์คํธ ๋ฐ์ค ๊ตฌ์กฐ๋ก ์์
ํฉ๋๋ค.
โข ๊ทธ ์ธ ์ด๋ ์์ด์ฝ๊ณผ dot๋ถ๋ถ์ ์์ด์ฝ์ ๊ฐ๊ฐ ํ๋๋ก ๋ฌถ์ด์ฃผ์ด์ ์ด๋ฏธ์ง | ์ด๋์์ด์ฝ | dot ์ธ๊ฐ์ ํฐ ํ์ ์ก์์ค๋๋ค.
<section id="sliderType" class="slider__wrap">
<h2 class="blind">์ฌ๋ผ์ด๋ ์์ญ</h2>
<div class="slider__inner">
<div class="slider">
<div class="slider__img">
<div class="desc">
<span>ANIMALS</span>
<h3>cUTE ANIMALS</h3>
<p>
๋๋ฌด ๋ฌด๋ฆฌํ์ง ๋ง์์! ์ด๋ฏธ ๋น์ ์ ์ํ๊ณ ์๊ณ !<br>
์์ผ๋ก๋ ์ ํ ์ ์์ด์!
</p>
<div class="btn">
<a href="#">์์ธํ ๋ณด๊ธฐ</a>
<a href="#" class="black">์ฌ์ดํธ ๋ณด๊ธฐ</a>
</div>
</div>
</div>
<div class="slider__arrow">
<a href="#" class="left"><span class="ir">์ด์ ์ด๋ฏธ์ง</span></a>
<a href="#" class="right"><span class="ir">๋ค์ ์ด๋ฏธ์ง</span></a>
</div>
<div class="slider__dot">
<a href="#" class="dot active"><span class="ir">1</span></a>
<a href="#" class="dot"><span class="ir">2</span></a>
<a href="#" class="dot"><span class="ir">3</span></a>
<a href="#" class="play"><span class="ir">ํ๋ ์ด</span></a>
<a href="#" class="stop"><span class="ir">์ ์ง</span></a>
</div>
</div>
</div>
</section>
< CSS ์์ค : ์คํ์ผ ์ ์ฉํ๊ธฐ >
๊ตฌ์กฐ ์ง์์ ์์๋๋ก css ์คํ์ผ์ ์ ์ฉ์์ผ ๋ด
์๋ค. ์ด ๋ ๋์์ธ ์์์ ์ฐธ๊ณ ํ๋ฉด์ html์ ๋ฒ๊ฐ์๊ฐ๋ฉฐ ํฐ ๋ฉ์ด๋ฆฌ ๋ถํฐ ์คํ์ผ์ ์ ์ฉ์์ผ ๋๊ฐ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค.
์์ฑ์ ๋ํ ๋ด์ฉ์ ์ฝ๋์ ์ฃผ์์ ๋ณด๋ฉด์ ์ดํดํด๋ด
์๋ค!
TIP !
โข ๋จผ์ ์ ์ฒด ์ด๊ธฐํ(Reset)์ ํฐํธ ๋ํดํธ ์ค์ ์ ํด์ฃผ๋ ๊ฒ์ด ์ข์ต๋๋ค.
โข ๊ฐ ์์ญ๊ณผ ์น์
์ ๋ฐ๋ณต์ ์ผ๋ก ๋ค์ด๊ฐ๋ ์์ฑ๋ค์ ๊ณตํต ์์ฑ์ผ๋ก ๋ฐ๋ก ์ค์ ํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
โข ์ปจํ
์ด๋ ์ค์ ์ ํตํด ๋ฉ์ธ ํ๋ฉด ํฌ๊ธฐ์ ์ฌ๋ฐฑ์ ์ค์ ํด์ค ๋ค ๋ฉ์ธ ์ฝํ
์ธ ์ธ ์น์
์๊ฒ ์คํ์ผ์ ์ ์ฉ์ํต๋๋ค.
โข span ํ๊ทธ๋ display: block๋ฅผ ๋จผ์ ์ค์ ํ์ฌ ์์
ํ๋ ๊ฒ์ด ํธ๋ฆฌํฉ๋๋ค.
โข text-underline-position: under๋ ํฌ๋กฌ ๋ธ๋ผ์ฐ์ ์๊ฒ๋ง ์ ์ฉ๋๋ ์์ฑ์ผ๋ก ์ธ๋๋ผ์ธ๊ณผ ํ
์คํธ์ ๊ฐ๊ฒฉ์ด ์กฐ๊ธ ์์ฑ๋ฉ๋๋ค.
โข ์ด๋ฏธ์ง๋ background: url()์ ์ด์ฉํ์ฌ ๋ฐฐ๊ฒฝ์ ์ฝ์
ํฉ๋๋ค.
/* font */
@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');
.nexon {
font-family: 'NexonLv1Gothic';
font-weight: 400;
}
/* reset */
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
}
em,
i,
address {
font-style: normal;
}
li {
list-style: none;
}
.blind{
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
}
/* common : ๊ณตํต ์์(์ฌํ์ฉ) */
.container {
width: 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;
color: #666;
text-align: center;
margin-bottom: 70px;
}
.gray {
background-color: #f5f5f5;
}
/* sliderType */
.slider__inner {
margin-top: 70px;
}
.slider {
position: relative;
}
.slider__img {
/* height: 500px; ๋ฐ์ ์ธ๋ถ ์์ญ ์ก๊ธฐ ์ ์ ๋์ถฉ ์ก์๋์ ์์ญ์ด๋ฏ๋ก ์ง์ฐ๊ธฐ */
background: url(../img/slider_type01_01.jpg) no-repeat center / cover;
}
.slider__img .desc {
width: 1160px;
margin: 0 auto;
padding: 100px 20px;
}
.slider__img .desc span {
font-size: 16px;
background-color: #fff;
padding: 1px 14px 0 14px;
border-radius: 30px;
text-transform: uppercase;
margin-bottom: 10px;
display: inline-block;
}
.slider__img .desc h3 {
font-size: 110px;
font-weight: 300;
line-height: 1;
color: #fff;
text-transform: uppercase;
margin-bottom: 16px;
margin-left: -8px;
}
.slider__img .desc p {
font-size: 20px;
font-weight: 300;
color: #fff;
line-height: 1.35;
margin-bottom: 130px;
}
.slider__img .desc .btn {}
.slider__img .desc .btn a {
font-size: 16px;
background-color: #fff;
padding: 11px 50px;
display: inline-block;
}
.slider__img .desc .btn a.black {
background: #000;
color: #fff;
}
.slider__arrow a {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 30px;
height: 56px;
background: url(../img/slider_icon.svg);
}
.slider__arrow a.left {
left: 20px;
}
.slider__arrow a.right {
right: 20px;
background-position: -50px 0; /* x์ถ์ผ๋ก -50px์ด๋ํด์ผ ๋์จ๋ค. */
}
.slider__dot {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 25px;
}
.slider__dot a {
display: inline-block;
width: 16px;
height: 16px;
background-image: url(../img/slider_icon.svg);
background-position: -20px -70px;
}
.slider__dot a.active {
background-position: 0 -70px;
}
.slider__dot a.play {
background-position: -40px -70px;
}
.slider__dot a.stop {
background-position: -60px -70px;
}
๐ ๊ฒฐ๊ณผ๋ณด๊ธฐ ๐
'SITE' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [SITE] ์น์ฌ์ดํธ - ํธํฐ ์ ํ 01 (1) | 2022.09.06 |
|---|---|
| [SITE] ์น์ฌ์ดํธ - ๋ฐฐ๋ ์ ํ01 (1) | 2022.09.06 |
| [SITE] ์น์ฌ์ดํธ - ์ด๋ฏธ์ง ํ ์คํธ ์ ํ01 (2) | 2022.09.02 |
| [SITE] ์น์ฌ์ดํธ - ํค๋ ์ ํ01 (4) | 2022.09.02 |
| [SITE] ์น์ฌ์ดํธ - ํ ์คํธ์ ํ03 (2) | 2022.09.01 |
๋๊ธ