我已将引导程序添加到我的网站。这是我正在使用的结构。 (我无法删除 bootstrap.css 文件,因为我根据自己的喜好修改了它)。
>app
>>assets
>>>fonts
>>>>4 glypicons icon files.
>>>images
>>>>N/A
>>>javascripts
>>>>Bootstrap.js (Jquery is installed in a gem)
>>>stylesheets
>>>>Bootstrap.css
一切都已正确导入,但问题是字形无法正常工作,而我需要它们!
2015 年 11 月编辑:我会推荐这个宝石:https://github.com/twbs/bootstrap-sass https://github.com/twbs/bootstrap-sass它由 Bootstrap 社区积极维护,并且与 Ruby on Rails 配合得非常好。
我遇到了和你非常相似的问题,但我弄清楚了!在 bootstrap.css 文件中找到此部分:
@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');
}
并替换../fonts/
with /assets
。这就是您的最终代码的样子。
@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');
}
我希望这有帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)