이미지 슬라이드 - 좌로 움직이기
<main>
<section>
<div class="slider__wrap">
<div class="slider__img">
<div class="slider"><img src="img/arch06.jpg" alt="이미지1"<>/div>
<div class="slider"><img src="img/arch07.jpg" alt="이미지2"<>/div>
<div class="slider"><img src="img/arch08.jpg" alt="이미지3"<>/div>
<div class="slider"><img src="img/arch09.jpg" alt="이미지4"<>/div>
<div class="slider"><img src="img/arch10.jpg" alt="이미지5"<>/div>
</div>
</div>
</section>
</main>
.slider__wrap {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.slider__img {
overflow: hidden;
width: 800px;
height: 480px;
}
.slider__img .slider {
position: absolute;
left: 0;
top: 0;
}
.slider::before {
position: absolute;
left: 5px;
top: 5px;
background: rgba(0, 0, 0, 0.4);
color: #fff;
padding: 5px 10px 3px;
}
.slider:nth-child(1)::before {content: '이미지1';}
.slider:nth-child(2)::before {content: '이미지2';}
.slider:nth-child(3)::before {content: '이미지3';}
.slider:nth-child(4)::before {content: '이미지4';}
.slider:nth-child(5)::before {content: '이미지5';}
.slider:nth-child(1) {z-index: 5;}
.slider:nth-child(2) {z-index: 4;}
.slider:nth-child(3) {z-index: 3;}
.slider:nth-child(4) {z-index: 2;}
.slider:nth-child(5) {z-index: 1;}