How can I add 'Font Awesome' to my app with twitter-bootstrap? [duplicate]

故事扮演 提交于 2019-12-11 05:11:01

问题


Possible Duplicate:
Rails: Using Font Awesome

I have Rails app in which I'm using many twitter-bootstrap's icon.

For that I did put "boostrap.css.erb" in /assets/stylesheets/ folder directly
also "glyphicons-halflings-white.png" and "glyphicons-halflings.png" in /assets/images/ folder directly.

Now I just downloaded Font awesome and extracted.
I'm guessing I have to do something with these files. Can anyone tell me how to set up?

/css/ folder

  • font-awesome-ie7.min.css
  • font-awesome.css
  • font-awesome.min.css

/font/ folder

  • fontawesome-webfont.eot
  • fontawesome-webfont.svg
  • fontawesome-webfont.ttf
  • fontawesome-webfont.woff
  • FontAwesome.otf

回答1:


Easy, just add your stylesheets to the head section of your html

    <link href="css/font-awesome.css" rel="stylesheet">
    <!--[if IE 7]>
    <link href="css/font-awesome-ie7.css" rel="stylesheet">
    <![endif]-->

And make sure you put all the font files in the same folder (I used /css as an example). Then to use the icons on a page, just do

<span class='icon-star'></span> 

(that inserts the icon using the css in the font-awesome.css file. Check there for all the possible classes. There's a bunch like icon-gear, icon-star, etc)



来源:https://stackoverflow.com/questions/14473224/how-can-i-add-font-awesome-to-my-app-with-twitter-bootstrap

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