我正在使用Bootstrap来创建轮播。我的照片没有出现,但正在旋转木马中使用的字形画面出现了。有人可以帮助我。 下面是我的代码和bootstrap安装。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="yas.css">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Change100 community</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="js/html5shiv.min"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#my-navbar">
<div class="container">
<section>
<div class="page-header" id="gallery">
<h2>Gallery <small></small></h2>
</div>
<div class="carousel slide" id="screenshot-carousel" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#screenshot-carousel" data-slide-to="0" class="active"></li>
<li data-target="#screenshot-carousel" data-slide-to="1"></li>
<li data-target="#screenshot-carousel" data-slide-to="2"></li>
<li data-target="#screenshot-carousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="item">
<img src="images/B.jpg" alt="this is the text for the image" class="active">
</div>
<div class="item">
<img src="images/2.jpg" alt="">
</div>
<div class="item">
<img src="images/d1.jpg" alt="">
</div>
<div class="item">
<img src="images/d.jpg" alt="">
</div>
</div><!--End carousel-inner-->
<a href="#screenshot-carousel" class="left carousel-control" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a href="#screenshot-carousel" class="right carousel-control" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div><!--End of carousel-->
</section>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
答案 0 :(得分:0)
您应该从此行更改活动类:
<img src="images/B.jpg" alt="this is the text for the image" class="active">
成为div,就像这样:
<div class="item active">
<img src="images/B.jpg" alt="this is the text for the image">
</div>