简体   繁体   English

Rails twitter-bootstrap-rails glyphicons无法正常工作

[英]Rails twitter-bootstrap-rails glyphicons are not working

When using the twitter-bootstrap-rails gem, the glyphicons aren't working. 使用twitter-bootstrap-rails gem时,字形图标不起作用。 I noticed that the resulting css has: 我注意到生成的CSS具有:

background-image: "/assets/twitter/bootstrap/glyphicons-halflings.png"

This isn't a valid css property, so of course it doesn't work. 这不是有效的CSS属性,因此当然不起作用。 I'm not doing anything special and this is being pulled in directly from the sprites.less file, which has: 我没有做任何特别的事情,这是直接从sprites.less文件中提取的,该文件具有:

background-image: @iconSpritePath;

I believe this should be translating to a background: url() in the resulting css, but this doesn't seem to be happening. 我相信这应该转换为背景:生成的CSS中的url(),但这似乎没有发生。

尝试这个:

 background-image: asset-url("glyphicons-halflings.png");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM