简体   繁体   English

如何修改 Bootstrap carousel next/prev icons Thickness

[英]How to modify Bootstrap carousel next/prev icons Thickness

I'm starting to learn HTML/CSS and Bootstrap.我开始学习 HTML/CSS 和 Bootstrap。

I have a carousel with the following next/prev buttons:我有一个带有以下下一个/上一个按钮的轮播:

<button class="carousel-control-prev" type="button" data-bs-target="#testimonials-carousel" data-bs-slide="prev">
   <span class="carousel-control-prev-icon" aria-hidden="true"></span>
   <span class="visually-hidden"> Previous </span>
</button>

<button class="carousel-control-next" type="button" data-bs-target="#testimonials-carousel" data-bs-slide="next">
   <span class="carousel-control-next-icon" aria-hidden="true"></span>
   <span class="visually-hidden"> Next </span>
</button>

I would like to change the thickness of the buttons so I tried to add this code in my CSS stylesheet:我想改变按钮的粗细,所以我尝试在我的 CSS 样式表中添加这段代码:

.carousel-control-prev {
    border-width: 35px;
}

.carousel-control-next {
    border-width: 35px;
}

I also tried:我也试过:

.carousel-control-prev-icon {
    border-width: 35px;
}

.carousel-control-next-icon {
    border-width: 35px;
}

But this has no effect.但这没有效果。 Just to be clear, I am not trying to change the height/width of the buttons but the thickness .需要说明的是,我不是要更改按钮的高度/宽度,而是要更改厚度 Do you have any idea how I could achieve this?你知道我怎么能做到这一点吗?

Thank you !谢谢 !

Bootstrap v5 uses a pre-defined set of icons ( https://getbootstrap.com/docs/5.2/extend/icons/ ). Bootstrap v5 使用一组预定义的图标 ( https://getbootstrap.com/docs/5.2/extend/icons/ )。 In earlier versions, it has been Glyphicons ( https://getbootstrap.com/docs/3.3/components/ ).在早期版本中,它是 Glyphicons ( https://getbootstrap.com/docs/3.3/components/ )。 You may change the referenced icon within the set (if one suits you), the icon set itself (to eg Font Awesome, Material Design Icons, ...) or, if ambitious enough, create an own icon for that purpose that you link in with CSS.您可以更改集合中引用的图标(如果适合您)、图标集本身(例如 Font Awesome、Material Design Icons 等),或者,如果雄心勃勃,可以为此目的创建自己的图标并链接在 CSS 中。

According to the Bootstrap Manual you may also re-define the $carousel-control-prev-icon-bg and $carousel-control-next-icon-bg variables with whatever SVG data you prefer ( https://getbootstrap.com/docs/5.2/components/carousel/ )根据 Bootstrap 手册,您还可以使用您喜欢的任何 SVG 数据重新定义$carousel-control-prev-icon-bg$carousel-control-next-icon-bg变量( https://getbootstrap.com/docs /5.2/组件/旋转木马/

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

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