Bootstrap Glyphicons不使用本地Bootstrap版本渲染 [英] Bootstrap Glyphicons not rendering using local Bootstrap version

查看:136
本文介绍了Bootstrap Glyphicons不使用本地Bootstrap版本渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在django中使用bootstrap,它适用于除了图标类之外的所有其他引导类: class =glyphicon glyphicon-download-alt

I am using bootstrap in django and it works perfectly for all other bootstrap classes except icon classes like: class="glyphicon glyphicon-download-alt"

右下角出现错误的快照

包含bootstrap.min.css文件时的快照:

>


在执行inspect元素时,它包含所有字形的快照是 -

On doing inspect element it contain all glyphicons its snapshot is-

>

只有在我的html文件中链接 http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css 但它不工作,如果我包括我的 bootstrap.min.css 从我的电脑。否则,每个引导类工作完美。希望你了解我的问题。提前感谢。

It only works if I link http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css in my html file; but it does'nt work if I include my bootstrap.min.css from my PC. Otherwise, every bootstrap class works perfectly. Hope you understand my problem. Thanks in advance.

推荐答案

它不工作,因为您从CDN链接保存了CSS文件。这将不工作,因为glyphicons相对于该CSS文件链接。示例:

It isn't working because you saved the CSS file from the CDN link. That won't work, because the glyphicons are linked to relative to that CSS file. Example:

@font-face{
    font-family:'Glyphicons Halflings';
    src:url(../fonts/glyphicons-halflings-regular.eot);
}

这意味着,下载的Bootstrap文件正在寻找glyphicons

What this means, is that the downloaded Bootstrap file is looking for the glyphicons in a folder on your computer (which you don't have).

您需要正确从下载Bootstrap。 //getbootstrap.com/getting-started#download\">官方下载链接。此官方下载包含一个包含实际字形字体文件的 / fonts / 目录。

You need to properly download Bootstrap from the official download link. This official download contains a /fonts/ directory that contains the actual glyphicon font files.

CDN文件中的所有字体路径都是到CDN上的字体的绝对链接...但这不是真的有意义。

Alternatively, you could change all of the font paths in the CDN file to be absolute links to the fonts on the CDN...but that doesn't really make sense.

这篇关于Bootstrap Glyphicons不使用本地Bootstrap版本渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆