프런트엔드-자바스크립트

자바스크립트 핵심

강사: 정프런트 · 작성자: 이종춘 · 작성일: 2026-06-11 21:23:17 · 조회수: 15

문제 8 : Swiper 슬라이드 만들기
목록으로
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>문제8</title>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.css">
<script src="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.js"></script>

<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}

.swiper{
width:800px;
height:500px;
margin:100px auto;
}

.swiper-slide{
display:flex;
justify-content:center;
align-items:center;
font-size:50px;
color:white;
}

.slide1{
background-color:tomato;
}

.slide2{
background-color:royalblue;
}

.slide3{
background-color:seagreen;
}
</style>
</head>

<body>

<div class="swiper">

<div class="swiper-wrapper">

<div class="swiper-slide slide1">1</div>
<div class="swiper-slide slide2">2</div>
<div class="swiper-slide slide3">3</div>

</div>

<div class="swiper-pagination pagination"></div>

<div class="swiper-button-prev prev"></div>
<div class="swiper-button-next next"></div>

</div>

<script>

const swiper = new Swiper('.swiper', {

loop:true,

pagination:{
el:'.pagination',
clickable:true,
},

navigation:{
nextEl:'.next',
prevEl:'.prev',
},

});

</script>

</body>
</html>
#문제 8 : Swiper 슬라이드 만들기

첨부 파일

0개
첨부된 파일이 없습니다.

댓글 / 답글

0개
댓글을 작성하려면 로그인하세요.
아직 댓글이 없습니다.