本文摘自PHP中文网,作者(*-*)浩,侵删。
其实不需要下面这么麻烦,只需要建一个fonts文件夹放在和js,css文件同级目录下,就可以正确引用。
关键是下面这几个文件得有:(推荐学习:Bootstrap视频教程)
1 2 3 4 | glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
|
相关的 CSS 规则写在 dist 文件夹内的 css 文件夹内的 bootstrap.css 和 bootstrap-min.css 文件上。
字体文件的路径请灵活改变
1 2 3 4 5 6 7 8 9 10 | <style type= "text/css" >
@font-face {
font-family: 'Glyphicons Halflings' ;
src: url( 'font/glyphicons-halflings-regular.eot' );
src: url( 'font/glyphicons-halflings-regular.eot?#iefix' ) format( 'embedded-opentype' ),
url( 'font/glyphicons-halflings-regular.woff' ) format( 'woff' ),
url( 'font/glyphicons-halflings-regular.ttf' ) format( 'truetype' ),
url( 'fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular' ) format( 'svg' );
}
</style>
|
所以 font-face 规则实际上是在找到 glyphicons 地方声明 font-family 和位置。
更多Bootstrap相关技术文章,请访问Bootstrap教程栏目进行学习!
以上就是bootstrap中fonts怎么引用的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
深入了解bootstrap中的媒体对象
bootstrap命令是什么意思
bootstrap如何设置表单必填
bootstrap与angularjs区别
深入浅析bootstrap中的自动定位浮标
bootstrap怎么学
深入了解bootstrap中的弹出框
bootstrap table中toolbar新增条件查询及refresh参数使用方法
bootstrap与vue区别
bootstrap 怎么安装
更多相关阅读请进入《bootstrap》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap中fonts怎么引用