【发布时间】:2018-08-29 16:24:24
【问题描述】:
我正在使用 Bootstrap 4.0 为 Carousel 使用白色背景,并且想更改控件的颜色。似乎 bootstrap 现在使用 SVG 作为其轮播图标。这意味着直接更改属性不起作用。
我目前也在网站上的其他元素中使用 Font Awesome,所以如果有一种方法可以使用 fa-chevrons 并对其进行格式化,并且它在调整大小和格式化方面仍然表现相同,那可能是有效的解决方案。
这是我当前的控制元素代码:
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
我发现了一个类似的问题here,但无法理解那里提供的答案。
我还在 GitHub 上找到了 this 页面,但也无法让那里的任何答案对我有用。
【问题讨论】:
-
fa-chevrons 和默认的 Bootstrap 控件有什么区别?我看不出有什么实质性的区别。
-
在视觉上它是一样的,但是理论上我可以直接改变颜色。由于引导控件使用 SVG,我无法直接使用 css 更改颜色。我不确定是否有一种简单可靠的方法可以在不改变一些隐藏行为的情况下用 fa-chevron 替换引导控件,因为我对引导没有太多经验。
标签: html css twitter-bootstrap bootstrap-4 carousel