ResponsiveSlides.js 和 Bootstrap 3

ResponsiveSlides.js with Bootstrap 3

我正在尝试将 ResponsiveSlides 滑块置于 bootstrap 列的中央,但无法正常工作。我有相当大的图像,所以我将 css 中的图像调整为 80%。当它是 100% 时,它们适合整个屏幕,但现在它们向左对齐。有人可以帮忙吗?谢谢!

<div class="col-xs-12">    
<ul class="rslides">
<li><a href="#"><img src="..." alt=""></a></li>
<li><a href="#"><img src="..." alt=""></a></li>
</ul>
</div>

Css:

.rslides {
  position: relative;
  list-style: none;
  overflow: hidden;
  width: 100%;
  padding: 0;
  }

.rslides li {
  -webkit-backface-visibility: hidden;
  position: absolute;
  display: none;
  width: 100%;
  left: 0;
  top: 0;
  }

.rslides li:first-child {
  position: relative;
  display: block;
  float: left;
  }

.rslides img {
  display: block;
  height: auto;
  float: left;
  width: 80%;
  border: 0;
  }

我觉得UL的宽度设置为80%,img的宽度设置为100%应该更好

.rslides {
    width: 80%;
    margin: 0 auto;
}

如果你想在不改变容器的情况下使IMG居中,你必须移除float: left;和相同的边距:0 auto;

.rslides img {
    display: block;
    height: auto;
    float: left;  <-- remove this
    width: 80%;
    border: 0;
    margin: 0 auto; <-- add
}