bootstrap字体图标怎么使用方法
Bootstrap捆绑了200多种字体格式的字形。首先让我们先来理解一下什么是字体图标。
什么是字体图标?
字体图标是在 Web 项目中使用的图标字体。虽然,Glyphicons Halflings 需要商业许可,但是您可以通过基于项目的 Bootstrap 来免费使用这些图标。
为了表示对图标作者的感谢,希望您在使用时加上 GLYPHICONS 网站的链接。
获取字体图标
我们已经在 环境安装 章节下载了 Bootstrap 3.x 版本,并理解了它的目录结构。在 fonts 文件夹内可以找到字体图标,它包含了下列这些文件:
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
相关的 CSS 规则写在 dist 文件夹内的 css 文件夹内的 bootstrap.css 和 bootstrap-min.css 文件上。
这里有200个class,每个class针对一个图标。这些class的常见格式如下:
.glyphicon-keyword:before {
content: "hexvalue";
}
如需使用图标,只需要简单地使用下面的代码即可。请在图标和文本之间保留适当的空间。
<span class="glyphicon glyphicon-search"></span>
相关推荐
  zh000    2015-11-16  
   twtonrg    2016-05-18  
   HLCsweet    2015-11-16  
   HLCsweet    2015-01-21  
   乔乔    2014-12-23  
   TemplarAssassin    2013-11-13  
   HLCsweet    2013-10-30  
   TemplarAssassin    2015-01-21  
   scnjl    2017-03-11  
   soulis    2017-05-17  
   niepxiya    2017-03-16  
   男儿何必尽成功    2019-05-09  
   niepxiya    2019-05-09  
   happymicer    2016-12-14  
   wuchangjian    2016-12-08  
   hllinc    2016-10-08  
   hllinc    2016-05-12  
   81437815    2016-05-01  
   wuchangjian    2016-01-28