This question already has answers here:
Font Awesome 5 on pseudo elements shows square instead of icon
(3 answers)
Font Awesome 5 Choosing the correct font-family in pseudo-elements
(1 answer)
Closed 4 years ago.
I'm trying to use fontawesome in React in css content and getting blank square instead of the icon. When using normally with html tag, it's working properly.
I installed the npm react-fontawesome and also pasted the cdn in my public index.html. I do prefer to use it in the old way (such as with pure js) and the normal html tags are working.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
css:
.answer-selected::before {
font-family: FontAwesome;
content: '\f00c'
}
Same icon is working as a html tag:
<i class="fas fa-check"></i>
Any ideas?
Thanks in advance
Related
This question already has answers here:
How to use CSS in Markdown?
(4 answers)
Closed 10 hours ago.
This post was edited and submitted for review 8 hours ago.
I have tried <link rel="stylesheet" type="text/css" href="style.css"> in markdown but that didn't work. Is there a way to do that?
I know using a style tag can work, but I wonder how to import a css in markdown. So I think the problem is different with How to use CSS in Markdown? . The link doesn't mention importing css in a markdown.
It should work, you can add css in three different ways
inline style
example : <p style="color: red">Username </p>
internal styling with the help of tag
example : <style> p {color: 'red'}</style>
external link
Using link tag, we can load css into html file
<link rel="stylesheet" href="<source-link>" />
I've been using fontawesome for one of my web projects and it works fine when I use the CDN link as its stylesheet but when I want to have everything locally and download FontAwesome(zip file) from the website, it becomes messy and shows multiple icons as some kind of bad zoom problem over its png file of icons.
the only change is
this
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
into this
<link src="assets/css/font-awesome/css/font-awesome.css" rel="stylesheet">
Again, the problem isnt that its not working, its how it shows multiple icons.
Assure you have downloaded the full package with correct version from the FontAwesome website and use a correct link, such as:
<link href="assets/css/font-awesome/css/font-awesome.css" rel="stylesheet" >
Reset your browsers cache.
Assure that the or element you use, uses the FontAwesome font family. For example:
<i class="fa-pencil" title="Edit"></i>
but
<i class="fa fa-pencil" title="Edit"></i>
It won't work if you have something as the following in your CSS:
* {
font-family: 'Josefin Sans', sans-serif !important;
}
If you are using IE, just dont...
If this doesn't work, just give it one hour or two(trust me sometimes browser plays jokes on itself), if problem was persistant, check https://github.com/FortAwesome/Font-Awesome/wiki/Troubleshooting
I am using bootstrap 3.3.7 and there are these 2 icons in FontAwesome which I need in Glyphicon:
fa fa-long-arrow-up
fa fa-long-arrow-down
Been trying several methods from StackOverFlow like icomoon but I cant understand as I dont have enough experience in CSS/font things. Can anyone help?
Simply add the following cdn into your header:
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
Alternatively, you can use these bootstrap glyphicons:
glyphicon glyphicon-arrow-up //For the Up Arrow.
glyphicon glyphicon-arrow-down //for the Down Arrow.
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">
This question already has answers here:
Using custom fonts using CSS?
(8 answers)
Closed 8 years ago.
I have been wanting to add custom fonts to my website using css.I have tried downloading from google fonts but it is not working.any other way of adding these fonts?
If you want add google font. i think you don't need to download. Go to google font site https://www.google.com/fonts choose you font and click on quick use button
Then you need to copy the link href code into head in your html file and add the font name in css file
first go to https://www.google.com/fonts , select your font and import it like this in your style.css
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300);
now you can use with , for example
div p { font-family : 'Open Sans' , Sans-serif }