好友
阅读权限10
听众
最后登录1970-1-1
|
各位大佬们,我在用bootstarp框架,设置了轮播图.但是我设置了css如下,但是
[CSS] 纯文本查看 复制代码 #carousel-example-generic .item img{
/*width: 100%;*/
height: 610px;
background-size: cover;
background-position: center center;
}
效果如下,但是我设置了居中,并且模式cover,照理说应该会拉伸填满整个背景,为何却不会拉伸呢??
轮播图的html源码如下,图片路径可能需要大佬们改下,我设置了本地的.
[HTML] 纯文本查看 复制代码 <section>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1" ></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="../imgs/pro1.jpeg" alt="...">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="../imgs/pro2.jpeg" alt="...">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="../imgs/pro3.jpeg" alt="...">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="../imgs/pro4.jpeg" alt="...">
<div class="carousel-caption">
...
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</section> |
免费评分
-
查看全部评分
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|