为什么我的DIV没有占满整个页面,而且我好像没听懂这节到底在讲什么
来源:2-1 swiper垂直滚动基本示例
Ting111
2020-09-26 13:09:58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="../作业/swiper-5.4.5/package/css/swiper.min.css">
<script src="../作业/swiper-5.4.5/package/js/swiper.min.js"></script>
<style>
body{
height: 100%;
width: 100%;
}
.box{
height: 100%;
width: 100%;
}
.container{
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<div class="box" id="box">1</div>
<div class="box" id="box">2</div>
<div class="box" id="box">3</div>
</div>
<script>
var a=new Swiper('box');
</script>
</body>
</html>1回答
同学你好,解答如下:
1、html也需要把高度设置为100%,例如:

2、本节讲的是使用第三方插件Swiper,实现轮播图的效果。如果同学也想实现和老师视频中一样的效果,html结构和类名要和老师的保证一致
祝学习愉快~
相似问题
回答 3
回答 2