Font Awesome icons alignment

。_饼干妹妹 提交于 2019-12-13 04:07:43

问题


I am using bootstrap-sass and font-awesome-sass-rails gems and have successfully eradicated duplicate icons (from glyphicons) by adding to bootstrap-and-overrides.css.scss:

[class^="icon-"] {
  background-image:none;
}

However, now I am having the problem of slightly out of line icons.. The glyphicons were perfect before. Now I am seeing:

I would like to move the icons down a pixel or 2. Please help. Thanks.


回答1:


Similar to the directions for LESS found on the Font-Awesome Integration section, one should remove the SASS for the glyph icons altogether, rather than just load the Font-Awesome SASS on top of it. I strongly discourage any approach that merely tries to save appearances by overriding CSS rules that don't need to be there in the first place.

I don't use Rails, but I assume the rough outline would be:

  1. Checkout a copy of the bootstrap-sass repo.

  2. Locate the _bootstrap.scss file.

  3. Replace the @import "bootstrap/sprites"; with @import "your/path/to/font-awesome";, where your/path/to/ contains the font-awesome.scss.

  4. Recompile the bootstrap.scss (don't forget to minify!).




回答2:


Im using the twitter-bootstrap-rails gem. I had to comment out:

  @iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings.png");

from bootstrap_and_overrides.css.less file



来源:https://stackoverflow.com/questions/12330032/font-awesome-icons-alignment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!