twitter-bootstrap - 用图像制作 Bootstrap 按钮

标签 twitter-bootstrap

我需要制作一个图像按钮,这样当您单击它时,它就会执行该按钮应该执行的操作。如果您想知道我需要它做什么,我正在制作一个旋转木马并尝试更改左右按钮。底部是我试图更改的代码。我需要它是我自己的图像,而不是字形图标。

</div>
  <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
</div><!-- /.carousel -->

最佳答案

在左侧和右侧控件中,替换以下代码行:

<span class="glyphicon glyphicon-chevron-left"></span>
<span class="glyphicon glyphicon-chevron-right"></span>

与:

<img class="img-responsive center-block" src="./path/to/image.jpg" alt="Your Alt Text">

在没有看到实际代码的情况下,很难说,但您可能需要调整图像的大小 - 或控制轮播控件大小的 CSS - 以使开关正确显示。不过,它不需要太多调整。

关于twitter-bootstrap - 用图像制作 Bootstrap 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26091072/

相关文章:

css - 未应用 Bootstrap 面板类

twitter-bootstrap - Bootstrap 下拉菜单只能使用一次

css - 在 Bootstrap 3 面板中安装 Highcharts.js 的问题

css - 创建模式的布局和样式

html - 使用 Bootstrap 在悬停时展开 div

html - 在 div 中添加一个新元素会将其他元素向下和向外推出

html - 单击按钮后 Bootstrap 不同的弹出窗口

css - 制作响应式长而细的旋转木马

reactjs - react 网格布局html不更新列

html - 增加 Font Awesome 图标