HTML/CSS [已解决] 关于 BS3 (Bootstrap 3) 的 GLYPHICONS 的使用的问题。

tianchaos · August 22, 2013 · Last by flymay_meimei replied at April 29, 2014 · 23816 hits

Bootstrap 3 的 Glyphicons 是 font 格式的。

所以要在 bootstrap 里面改 src 地址。

可是在 rails 里面要怎么实现呢。怎么样写 css 才能覆盖掉 bootstrap 呢。

用 bootstrap 的 gem 也不知道应该用哪一个诶。

试了好久都不能把 icon 正常显示出来,取不出字体就自动变成 serif 的字体了,成这样。

正常显示出来应该是左右箭头。

小弟 rails 新手,实在不行只好来这里求救了。

不知道诸位大神都是怎么解决这个问题的?


[已解决]

补充:

小弟重新下载了一次字体文件。

--- 仍然同样的情况。

清除浏览器的缓存。

--- 同样的情况, but 在浏览了一下别的网站又重新回来的时候就好咯。(这个应该是加载字体要一些时间)

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('/fonts/glyphicons-halflings-regular.eot');
  src: url('/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
       url('/fonts/glyphicons-halflings-regular.woff') format('woff'),
       url('/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
       url('/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

指定到你想要的 path 上就行

@raecoo

我之前就是这么改的 这样

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('/assets/glyphicons-halflings-regular.eot');
  src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/assets/glyphicons-halflings-regular.woff') format('woff'), url('/assets/glyphicons-halflings-regular.ttf') format('truetype'), url('/assets/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

可是还是那个样子。

不知道为什么不行,所以在想会不会是 assets pipeline 的某个机制造成的。

@raecoo 问题已经解决,谢谢啦!

请问下,您是怎么修改的?

@xhhuang 你说的是哪里呢?

#5 楼 @tianchaos 怎么解决问题的?

@aaronluo 在浏览了一下别的网站又重新回来的时候就好咯。

@ tianchaos 可以给我下载的文字包吗?我找不到下载的地方。。谢谢!!非常感谢

You need to Sign in before reply, if you don't have an account, please Sign up first.