问题
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