在最近的项目中,用到了bootstarp的Carousel,但是却发现他左右两边有个灰色的阴影存在,让人看起来很别扭,百度完之后也没有找到解决办法,只好自力更生,处理方法如下:


carousel如下所示:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<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>
</ol>


  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="img/photo11.jpg" alt="">
      <div class="carousel-caption"><!--某公司所有--></div>
    </div>
   
    <div class="item">
      <img src="img/photo12.jpg" alt="">
      <div class="carousel-caption"><!--某公司所有--></div>
    </div>
   
    <div class="item">
      <img src="img/photo13.jpg" 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>


在样式表中加入:

<style>
.left{
text-shadow:none;
}

.carousel-control.right, .carousel-control.left{
background-image: none;
}

</style>


Logo

助力广东及东莞地区开发者,代码托管、在线学习与竞赛、技术交流与分享、资源共享、职业发展,成为松山湖开发者首选的工作与学习平台

更多推荐