简体   繁体   English

如何在Bootstrap滑块中设置指示器的样式?

[英]How to style the indicators in Bootstrap slider?

On the local environment, we changed the CSS for the round indicators for the slider and it works great. 在本地环境中,我们更改了圆形指示器的CSS,效果很好。 When we upload, the packages get updated from GitHub and we loose our changes. 当我们上传时,这些包会从GitHub更新,并且我们放弃所做的更改。

We handle that by adding our own CSS file and styling upon Bootstrap's. 我们通过添加自己的CSS文件并在Bootstrap上设置样式来处理该问题。 This works great for the components that we have an ID for. 这对于我们具有ID的组件非常有用。 However, we're not clear on the ID of the dotty thingies that function as indicator on the slider. 但是,我们尚不清楚用作滑块上指示符的东西的ID。

How do I find their ID so I can add my own class upon the one provided by Bootstrap? 如何找到他们的ID,以便可以在Bootstrap提供的类上添加自己的类?

<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
    <li data-target="#myCarousel" data-slide-to="3"></li>
  </ol>
  ...

You can simply add a class attribute to all of the navigation dots without overriding bootstrap's settings. 您可以简单地将class属性添加到所有导航点,而无需覆盖bootstrap的设置。 The active class is added via JavaScript at the end of all existing classes anyway. 无论如何, active类都是通过JavaScript添加到所有现有类的末尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM