css - bootstrap 轮播指示器的距离不相等?

标签 css twitter-bootstrap

我目前在这里,想知道为什么 bootstrap carousel 指示器距离不相等?

enter image description here

正如您在图片中看到的第一个和第二个指示器(子弹)之间的距离。

#carousel-example-generic-right .carousel-indicators .active {
    background-color: #990000;
}
.carousel-indicators li {
   width: 12px;
   height: 12px;
}

我只改变每个元素符号的宽度和高度以及事件状态。

工作代码笔 here

如果有人能帮忙解决这个问题就好了?

最佳答案

您的代码看起来运行良好。

但是,您需要在添加 Bootstrap 文件之前添加正确版本的 Jquery。见下文:

已更新

包含在评论中的版本(不是最新的)

根据评论,添加截图: enter image description here

#carousel-example-generic-right {
  background-color: #ccc;
}
.carousel-indicators li.active {
  border: 1px solid #990000;
}
#carousel-example-generic-right .carousel-indicators .active {
  background-color: #990000;
}
#carousel-example-generic-right .carousel-indicators li {
  background-color: #fff;
}
.carousel-indicators li {
  width: 12px;
  height: 12px;
}
.item {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}
<!-- jquery 1.11.1  -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<!-- bootstrap 3.3.5 -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.js"></script>

<div id="carousel-example-generic-right" class="carousel slide white box-shadow-rounded" data-interval="false" data-ride="carousel" style="height:200px;">
  <ol id="aux-box-carousel-pagination" class="carousel-indicators">
    <li class="active" data-slide-to="0" data-target="#carousel-example-generic-right"></li>
    <li data-slide-to="1" data-target="#carousel-example-generic-right"></li>
    <li data-slide-to="2" data-target="#carousel-example-generic-right"></li>
    <li data-slide-to="3" data-target="#carousel-example-generic-right"></li>
  </ol>
  <div id="aux-box-carousel" class="carousel-inner" role="listbox">
    <div class="item active">
      Slide 1
    </div>
    <div class="item">
      Slide 2
    </div>
    <div class="item">
      Slide 3
    </div>
    <div class="item">
      Slide 4
    </div>

  </div>

</div>

关于css - bootstrap 轮播指示器的距离不相等?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36416360/

相关文章:

css - 无法创建非粘性页脚

css - 如何防止 div_1 的悬停状态影响 div 2 定位?

javascript - AngularJS:使用 ng-show/hide 动态维护下拉列表的 3 种状态(进行中、成功、错误)?

twitter-bootstrap - Bootstrap 4 的媒体对象对齐(Flexbox)

php - 未应用网站样式。 (从 php 包含调用 stylesheet.css)

html - 将日期选择器添加到 JetStrap 页面 (Twitter Bootstrap)

javascript - 日期选择器弹出窗口不起作用

html - 垂直对齐内容

javascript - jQuery - 在 if 语句参数中使用 css

html - css,将 2 个元素保持在同一行。切割第二个元素的宽度以保持在线