最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Bootstrap 4中如何引用其他字体比如Font Awesome

Bootstrap crifan 1064浏览 0评论
折腾:
【未解决】bootstrap 4中如何给输入框右边加上清除叉叉的按钮
期间,需要去搞清楚Bootstrap 4中如何,导入,引用,别的字体
目标是使用其中的font icon,比如x的close的icon。
搜:
bootstrap 4 how use font icon
css – Using Font Awesome with Bootstrap 4 – Stack Overflow
Learn About Different Icon Fonts in Bootstrap 4
html – Bootstrap 4 Font Awesome – Stack Overflow
好像引入css即可?
Icons · Bootstrap
Octicons
https://octicons.github.com/icon/x/
Icons – Material Design
primer/octicons: A scalable set of icons handcrafted with <3 by GitHub
先去下载一个试试
https://registry.npmjs.org/octicons/-/octicons-8.1.0.tgz
最后是:采用Font Awesome的close的图标
具体步骤:
Font Awesome 中文网 – | 字体图标
下载到:
http://www.fontawesome.com.cn/download/font-awesome-4.7.0.zip
解压得到:
│   ├── font-awesome-4.7.0
│   │   ├── HELP-US-OUT.txt
│   │   ├── css
│   │   │   ├── font-awesome.css
│   │   │   └── font-awesome.min.css
│   │   ├── fonts
│   │   │   ├── FontAwesome.otf
│   │   │   ├── fontawesome-webfont.eot
│   │   │   ├── fontawesome-webfont.svg
│   │   │   ├── fontawesome-webfont.ttf
│   │   │   ├── fontawesome-webfont.woff
│   │   │   └── fontawesome-webfont.woff2
│   │   ├── less
│   │   │   ├── animated.less
│   │   │   ├── bordered-pulled.less
│   │   │   ├── core.less
│   │   │   ├── fixed-width.less
│   │   │   ├── font-awesome.less
│   │   │   ├── icons.less
│   │   │   ├── larger.less
│   │   │   ├── list.less
│   │   │   ├── mixins.less
│   │   │   ├── path.less
│   │   │   ├── rotated-flipped.less
│   │   │   ├── screen-reader.less
│   │   │   ├── stacked.less
│   │   │   └── variables.less
│   │   └── scss
│   │       ├── _animated.scss
│   │       ├── _bordered-pulled.scss
│   │       ├── _core.scss
│   │       ├── _fixed-width.scss
│   │       ├── _icons.scss
│   │       ├── _larger.scss
│   │       ├── _list.scss
│   │       ├── _mixins.scss
│   │       ├── _path.scss
│   │       ├── _rotated-flipped.scss
│   │       ├── _screen-reader.scss
│   │       ├── _stacked.scss
│   │       ├── _variables.scss
│   │       └── font-awesome.scss
代码中加上:
<link rel="stylesheet" href="css/font-awesome-4.7.0/css/font-awesome.min.css">
然后去调用:
<i class="fa fa-times"></i>
效果是:
 

转载请注明:在路上 » 【已解决】Bootstrap 4中如何引用其他字体比如Font Awesome

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
87 queries in 0.169 seconds, using 21.94MB memory