How to use font awesome with css - css

How can I use font-awesome in css? I searched and see that I just need to download and copy font-awesome directory into my porject then display the icon by using content in css. But instead of displaying awesome icons, it displayed weird and undefinable characters. Does anyone know how to use/fix it properly?

add this in the head of your html page: <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

Related

What is the difference between Use Font-awesome all.js and all.css?

I have to use font awesome in my Web, and I found that I have 2 ways to implements Font Awesome.
I want to work with 5.0.1 version, I realized that using ALL.CSS allows me to use Font-awesome in classes with: AFTER in CSS, but beyond that I do not know what the difference is, and what each one is used for, and another question, when I should use both.
<link href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.0.1/js/all.js"></script>
I hope to use the lightest font-awesome to implement
all.css is the font version of FontAwesome.
When you need the SVG font, you have to use js.css version.
More detail can be found on their website
Choose the javaScript (.js) OR the css (.css) version, not both.
.js : Retrieves the <i> tags with class name fa and replaces them with the code from an svg image. This is a good option if you don't have a lot of Font Awesome icons on your web page.
.css : Loads the Font Awesome font family (for example v5.0.1 = 37.78 kB). This is a good option when you have a large number of icons on your web page.

installing font awesome and sass

Im trying to install font awesome to my simple sass project i have.
1 simple html page linking to 1 css file that is spit out via my sass.
Is there anyway of installing it locally to that project folder?
I couldnt see anything on the website
http://fontawesome.io/get-started/
You have to link it through ruby rails.
Ive managed to import font awesome but the icon just shows up as a box so i think its looking for the missing svg.
Try to this:
Go to this site: http://fontawesome.io/get-started/
and Click no Download Folder.
Add font-awesome.css stylesheet in your head tag &
Add font folder also, Please give font path proper in the font-awesome.css stylesheet.
<head>
<link rel="stylesheet" href="[http://fontawesome.io/assets/font-awesome/css/font-awesome.css][1]"/>
</head>

How can I use FontAwesome Font Icons without uploading it to project?

I have a blog. Now I want to use a font icon for Menu bar for good quality.
But I can't upload it to blogger as there's no option. So is there any way to use it without uploading it to blogger?
you can use a CDN and link it in your project like this
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>
As answered you can use fontawesome cdn or if you want to further optimize, you can choose specific icons and load a css file.
you can use http://fontello.com/ or https://icomoon.io which are awesome tools for this.
hope this helps :)

Bootstrap - Only shows two glyphicons in bootstrap 3

I imported the css/js/font of bootstrap3 in my sample html page. But in the case of glyphicons. It shows only two Glyphicon properly (glyphicon-asterisk, glyphicon-plus). All others are not showing. So i open the glyphicons-halflings-regular.ttf file and it shows only two symbols (glyphicon-asterisk, glyphicon-plus) with some texts. May be this becomes the problem. How can i resolve this problem?
Try including this link
It will show all glyphs.
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
or refer this LINK for CDN

Bootstrap glyphicons without changing fonts

I am using Bootstraps glyphicons, including them like this:
<!-- Load Bootstrap CSS (Flatly) and Javascript -->
<link rel="stylesheet" href="http://bootswatch.com/flatly/bootstrap.min.css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
Before I loaded the glyphicons CSS file my fonts were fine. I did not set the font, instead using whatever Bootstrap or jQuery sets the font by default.
Now I have included that glyphicon CSS file, my fonts have changed. Can I utilize the glyphicons whilst ignoring the fonts?
As you can see here http://www.bootply.com/5Amv5odg7X you don't need to load the glyphicons separately, just be sure to load stock Bootstrap before flatly, and you're good to go.
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://bootswatch.com/flatly/bootstrap.min.css">
Also, it's usually considered best practice load your .js files after all html content, so it doesn't impact page load.
You are using a custom version of Bootstrap css that already includes the icons and imports a custom Google font. Check the file you're linking to here:
<link rel="stylesheet" href="http://bootswatch.com/flatly/bootstrap.min.css">
This file contains all of the styles for the glyphicons embedded in it, so no need to separately add the link to the cdn for <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">.
As for you fonts "changing", the first line in this file imports the Lato font from Google and sets as the body font. If you don't want to use the custom font, download the flatly css file (instead of linking to the remote file) and remove the import statement at the top of the css file. Or, override the styles in your own css file. (Better to do the former, as it would be a waste to have your site visitors download the Google fonts, if you're not using them).

Resources