尝试在我的网站上实施bootstrap轮播。我得到的结果如下。思考?我不认为这是一个CSS问题,但我不太确定。我环顾四周,无法找到一个确定的答案,为什么我的实施没有正确出来。
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<title>Welcome</title>
<link href ="WorkingFolder/css/bootstrap_custom/bootstrap.css" rel ="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-right">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href ="#">|X|</a>
</div>
<!--Navigation control-->
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href ="#">Home</a></li>
<li><a href="Portfolio.html">Portfolio</a></li>
<li><a href ="Services.html">Services</a></li>
</li>
</ul>
</div>
</div>
</nav>
<div class ="container">
<div id="mycarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#mycarousel" data-slide-to="0" class="active"></li>
<li data-target="#mycarousel" data-slide-to="1"></li>
<li data-target="#mycarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="slide1"></div>
<div class="carousel-caption">
<h1>William Xavier Fernandez</h1>
<p>|X|</p>
<p><a href="#" class="btn btn-primary btn-sm">More Detail</a></p>
</div>
</div>
<div class="item">
<div class="slide2"></div>
<div class="carousel-caption">
<h1>Web Design|Bootstrap|JQuery|</h1>
<p>|X|</p>
</div>
</div>
<div class="item">
<div class="slide3"></div>
<div class="carousel-caption">
<h1>View my portfolio of work above</h1>
<p>|X|</p>
</div>
</div>
</div>
<!--Navigation control-->
<a class="left carousel-control" href="#mycarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#mycarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
<div class="container">
<p>blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah</p>
</div>
<script src = "WorkingFolder/jquery-3.0.0.min.js"></script>
<script src="WorkingFolder/js/bootstrap.min.js"></script>
</body>
`
答案 0 :(得分:0)
查看bootstrap文档,看起来他们已经设置了img
设置幻灯片背景,并且您正在使用带幻灯片编号的div ...我不知道这是否是唯一的原因在这里,但我做了一个小提琴,而不是使用
<div class="slide2"></div>
我投入;
<img src="image.jpg"/>
这就是我能说出来的。