首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何更改引导转盘控件链接的大小?

问如何更改引导转盘控件链接的大小?
EN

Stack Overflow用户
提问于 2017-09-17 02:41:14
回答 4查看 9.1K关注 0票数 1

默认引导轮播控件(左箭头和右箭头)具有跨越轮播中图像高度的100%的链接。我很抱歉,因为这可能是一个愚蠢的问题,但你如何改变这一点,使链接只超过箭头本身的宽度和高度?

您可以在Boostrap文档(https://getbootstrap.com/docs/3.3/javascript/#carousel)上的" carousel“下看到我所指的示例,旋转木马的代码如下所示。

代码语言:javascript
复制
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="..." alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
    <div class="item">
      <img src="..." alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
    ...
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
EN

回答 4

Stack Overflow用户

发布于 2017-09-17 03:39:22

使用'carousel-control‘添加一个类,然后添加以下CSS。或者您可以直接将此CSS添加到您的代码中

代码语言:javascript
复制
#carousel-example-generic a.carousel-control {
height: 26%;
top: 33%;
width: 86px;
background: black;
//add your own CSS as you need
}
票数 3
EN

Stack Overflow用户

发布于 2017-09-17 03:35:10

同时添加.carousel-control.left和.carousel-control.right,

代码语言:javascript
复制
//change the margin to make the width and height more longer or shorter
   margin: 100px 0;
//change the radius to make the point of the squared-hover looks rounded
   border-radius: 60px;
票数 1
EN

Stack Overflow用户

发布于 2021-05-28 04:43:16

我在谷歌上搜索了一下,找到了我自己的解决方案,所以我添加了Bootstrap 4.x的解决方案,这样其他人就可以找到这个简单的解决方案。由于图标是SVG,因此同时调整高度和宽度将更改图标的大小。我曾假设如果我增加宽度,它们会改变大小,但事实并非如此。我使用了vw,所以它们可以随着屏幕缩放,但你可以使用任何你想要的单位。

代码语言:javascript
复制
.carousel-control-next-icon,
.carousel-control-prev-icon {
  width: 5vw;
  height: 5vw;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46257264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档