效果图:
源码:
<!DOCTYPE html>
<html>
<head>
<title>超链接轮播图</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<style>
/* Make the image fully responsive */
.carousel-inner img {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- 指示符 -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>
<!-- 轮播图片 -->
<div class="carousel-inner">
<div class="carousel-item active">
<a href="https://www.baidu.com/"> <img src="https://static.runoob.com/images/mix/img_fjords_wide.jpg"></a>
<div class="carousel-caption">
<h3>第一张图片描述标题</h3>
<p>描述文字!</p>
</div>
</div>
<div class="carousel-item">
<a href="https://blog.csdn.net/"><img src="https://static.runoob.com/images/mix/img_nature_wide.jpg"></a>
<div class="carousel-caption">
<h3>第二张图片描述标题</h3>
<p>描述文字!</p>
</div>
</div>
<div class="carousel-item">
<a href="https://www.bilibili.com/"><img src="https://static.runoob.com/images/mix/img_mountains_wide.jpg"></a>
<div class="carousel-caption">
<h3>第三张图片描述标题</h3>
<p>描述文字!</p>
</div>
</div>
</div>
<!-- 左右切换按钮 -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</body>
</html>