gpt4 book ai didi

jquery - 我无法使用 Bootstrap 将图像链接到我的轮播中主机上的页面

转载 作者:行者123 更新时间:2023-11-28 02:29:57 25 4
gpt4 key购买 nike

我正在尝试将轮播中的图片链接到我网站上的页面。我在这里查看了其他答案 ( Href in Bootstrap Carousel ) 我在需要的地方添加了 href,并且我从 Bootstrap 站点获得了正确的 .js。该链接与页面位于同一主机上,因此它至少应该让我可以选择单击它并转到错误的页面(404),但它甚至根本不像链接一样,没有选项甚至点击它。我还尝试了网页本身的链接 http://mywebsite.com/pageiwant .我对此很陌生,我使用 HTML 的时间很短。我做错了什么?我正在使用 Bootstrap 4。提前致谢!

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

<link rel="stylesheet" href="css/bootstrap.min.css">

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>

</head>
<body>

<div class="container">

<div class="col-lg-9 col-centered align-right">

<div id="carouselExampleIndicators" class="carousel slide my-4" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="img/peridotandprehnite900x350.jpg" href="peridotandprehnite.html" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="img/sterlingsilverdaisychain900x350.jpg" href="sterlingsilverchainwithdaisies.html" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="img/copperowl900x350.jpg" href="copperowlontwostrandcopperchain.html" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

<footer class="py-2 bg-color:#7EC1BD fixed-bottom">
<div class="container">
<p class="m-0 text-center text-white">Meow Meow Meow</p>
</div>
<!-- /.container -->
</footer>

</body>
</html>

最佳答案

天哪,甜甜的 bajeezus!我想通了使用 How do I add a links to pictures in Twitter Bootstrap Carousel? .通过将每个图像包装到 href 中,它现在可以完美地工作了!

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

<link rel="stylesheet" href="css/bootstrap.min.css">

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>

</head>
<body>

<div class="container">

<div class="col-lg-9 col-centered align-right">

<div id="carouselExampleIndicators" class="carousel slide my-4" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<a href="peridotandprehnite.html">
<img class="d-block img-fluid" src="img/peridotandprehnite900x350.jpg" alt="First slide">
</a>
</div>
<div class="carousel-item">
<a href="sterlingilverdaisychain.html">
<img class="d-block img-fluid" src="img/sterlingsilverdaisychain900x350.jpg" alt="Second slide">
</a>
</div>
<div class="carousel-item">
<a href="copperowlontwostrancopperchain.html">
<img class="d-block img-fluid" src="img/copperowl900x350.jpg" alt="Third slide">
</a>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

<footer class="py-2 bg-color:#7EC1BD fixed-bottom">
<div class="container">
<p class="m-0 text-center text-white">Meow Meow Meow</p>
</div>
<!-- /.container -->
</footer>

</body>
</html>

关于jquery - 我无法使用 Bootstrap 将图像链接到我的轮播中主机上的页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51414827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com