Safari中的Bootstrap轮播文本昏暗

时间:2014-12-21 17:33:26

标签: css twitter-bootstrap-3 safari carousel

我正在使用Bootstrap 3.3.1,我注意到当旋转木马在Safari中滚动时文本会变暗。 Chrome很好。

这是一个演示,使用官方网站上的示例代码:http://s.codepen.io/resting/debug/QwEoPp
笔:http://codepen.io/resting/pen/QwEoPp

代码:

<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>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://placehold.it/1024x400" alt="...">

      <div class="carousel-caption">
        ...
      </div>
    </div>
    <div class="item">
      <img src="http://placehold.it/1024x400" 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>

<div class="container-fluid">

  <div class="row">
    <div class="col-xs-12">
      Text dim in Safari when carousel scrolls.
    </div>
  </div>
</div>

有人对此有任何解决方法吗?

2 个答案:

答案 0 :(得分:4)

已修复

.carousel-inner {
  -webkit-transform-style: preserve-3d;
}

答案 1 :(得分:3)

您是否尝试在文字中添加-webkit-transform-style: preserve-3d;-webkit-backface-visibility: hidden;?在safari中闪烁的文本似乎是一个常见的问题,这些是两个常见的修复。

.carousel-inner {
  -webkit-transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
}