Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use FontAwesome without classes and without Bootstrap in a Rails project?

I am trying to use FontAwesome in my Rails project but without Bootstrap or having to use classes à la <i class="icon-camera-retro"></i>.

I dropped all the 5 font files into my folder /assets/fonts and then in my base.css I do this:

@font-face {
  font-family: 'FontAwesome';
  src: url('fontawesome-webfont.eot?v=3.0.1');
  src: url('fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
  url('fontawesome-webfont.woff?v=3.0.1') format('woff'),
  url('fontawesome-webfont.ttf?v=3.0.1') format('truetype');
  font-weight: normal;
  font-style: normal;
}

Then I want to do something like this:

<span class="foo">Text</span>

.foo:before {
  font-family: 'FontAwesome';
  content: "\2022";
}   

The problem is it's not working at all.

Can anybody tell me how it's done?

Thanks for any help.

like image 364
Tintin81 Avatar asked Dec 26 '22 20:12

Tintin81


1 Answers

I think your code is fine, I have it working the same:

span:before {
content: "\f059";
font-family: 'FontAwesome';
font-size: 120%;
}

I have a question icon ( icon-question-sign - &#xf059;)

My question to you is what is this?

content: "\2022";

I do no see it in here...might be your answer..:

FontAwesome Sheet

icon-camera-retro should be:

content: "\f083";

like image 83
Riskbreaker Avatar answered Dec 28 '22 08:12

Riskbreaker