我已经从官方文档中读到,从bootstrap 4中删除了字形。
今天,在我寻找实施复选框按钮时,我找到了一个我非常感谢的片段:
复选框3.0
的片段问题在于此版本适用于Bootstrap 3.0,该版本尚未支持字形。
所以我有2个问题:
- 哪种是甘同语的好替代品?还是有一种使用它们的方法?
- 我如何更改上面的HTML和JS片段,以使其与Bootstrap 4一起使用?
1-哪个是字形的替代品?或者有一种使用它们的方法?
最好的替代恕我直言: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"
。
我同意@nerijunior字体真棒图标是最好的选择,这是如何测试的:
要使用字体很棒的图标,请在下面给出以下示例(不需要下载或安装)以下示例:
:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1>My Icons <i class="fas fa-heart"></i></h1>
<p>An icon along with some text: <i class="fas fa-thumbs-up"></i></p>
</div>
<div class="container">
<p>Others:</p>
<i class="fas fa-cloud"></i>
<i class="fas fa-coffee"></i>
<i class="fas fa-car"></i>
<i class="fas fa-file"></i>
<i class="fas fa-bars"></i>
</div>
</body>
</html>
来源:https://www.w3schools.com/bootstrap4/bootstrap_icons.asp