我正在使用bootstrap-switch和bootstrap v3。
我想使用图标在交换机上显示文本。
如果我使用像这样的字体真棒图标它的工作原理。 using font awesome using font awesome,这里是代码:
$("[name='pets_check_box']").bootstrapSwitch('onText', '<i class="fa fa-check" aria-hidden="true"></i>');
$("[name='pets_check_box']").bootstrapSwitch('offText', '<i class="fa fa-times" aria-hidden="true"></i>');
如果我使用bootstrap glyphicon图标不显示... using bootstrap glyphicon using bootstrap glyphicon这里是代码:
$("[name='pets_check_box']").bootstrapSwitch('onText', '<span class="glyphicon glyphicon-ok"></span>');
$("[name='pets_check_box']").bootstrapSwitch('offText', '<span class="glyphicon glyphicon-remove"></span>');
当我使用没有bootstrap-switch的glyphicon时,glyphicon正常工作。有人有解决方案吗?
最新版本的Bootstrap(> = v4.0)不支持glyphicon图标。在他们提到的官方网站上,如果你需要图标,一些选项是:
查找以下链接以阅读详细信息。
确保你有include bootstrap.css和bootstrap.css在下面的条目
.glyphicon-ok:before { content: "\e013";}