bootstrap中fonts如何引用

发布时间:2020-09-21 11:03:56 作者:小新
来源:亿速云 阅读:144

这篇文章将为大家详细讲解有关bootstrap中fonts如何引用,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

其实不需要下面这么麻烦,只需要建一个fonts文件夹放在和js,css文件同级目录下,就可以正确引用。

关键是下面这几个文件得有:

glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff

相关的 CSS 规则写在 dist 文件夹内的 css 文件夹内的 bootstrap.css 和 bootstrap-min.css 文件上。

字体文件的路径请灵活改变

<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中fonts如何引用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

推荐阅读:
  1. bootstrap基础引用文件
  2. bootstrap标签标明引用来源

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

bootstrap fo

上一篇:bootstrap设置图标大小的方法

下一篇:redis如何实现集群

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》