Bootstrap 4 不再支持字形 [英] Glyphicons no longer supported in Bootstrap 4

查看:24
本文介绍了Bootstrap 4 不再支持字形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从官方文档中了解到 Glyphicons 已从 Bootstrap 4 中删除.

I've read, from official docs, that Glyphicons were dropped from Bootstrap 4.

今天,在我寻找实现复选框按钮的过程中,我发现了一个我非常欣赏的片段:

Today, in my searching for implementing checbox button, I've found one snippet that I appreciate very much:

Checkbox 3.0 的代码段

问题是此版本适用于 Bootstrap 3.0,其中 Glyph 尚受支持.

The problem is that this version is for Bootstrap 3.0, where Glyph were supported yet.

所以我有两个问题:

  1. Glyphicons 的替代品是什么?或者还有一种方法可以使用它们吗?
  2. 如何更改上面的 html 和 js 代码段以使其在 Bootstrap 4 中正常工作?

推荐答案

1 - 哪个是 Glyphicons 的不错替代品?或者还有什么方法可以使用它们?

最好的替代恕我直言:http://fontawesome.io/icons/

2 - 我如何更改上面的 html 和 js 片段以使其在 Bootstrap 4 中工作?

jQuery 复选框按钮 - Bootstrap 4

您需要更改 JS:

settings = {
    on: {
        icon: 'fa fa-square-o'
    },
    off: {
        icon: 'fa fa-check-square-o'
    }
};

并且 css 类 .hidden 现在已被弃用,因此 Bootstrap 建议使用 style="display: none" 代替.

And the css class .hidden is now deprecated so Bootstrap recommends to use style="display: none" instead.

这篇关于Bootstrap 4 不再支持字形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆