Font awesome icons not appearing on my page - html

I am currently trying to get icons to appear on my web page but it appears that there's a problem. On my homepage the icons work, on my about page however, all that appears are squares. Here is the corresponding code:
HTML:
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-
awesome.min.css">
<link href="http://fonts.googleapis.com/css?family=Cookie" rel="stylesheet" type="text/css">
<div class="footer-icons">
<i class="fa fa-facebook"></i>
<i class="fa fa-twitter"></i>
<i class="fa fa-instagram"></i>
<i class="fa fa-youtube"></i>
</div>

Sorry to state the obvious, but given that you get different outcomes in different contexts your question should indicate what is different about those contexts. The problem doesn't appear to be in this code, alone.

Related

about Font Awesome icons

I am creating a html file where i used fontawsome icons
when i am using any brand icon like facebook, discord,etc it just shows up normally, but when i use any normal icons like magnifying tool and any other it just showing some squares and doesn't shows up the real icon i added the latest fontawsome cdn in head also.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<i class="fa-brands fa-discord"></i>
<i class="fa-regular fa-magnifying-glass"></i>
<i class="fa-duotone fa-phone"></i>
<i class="fa-brands fa-whatsapp"></i>
<i class="fa-solid fa-magnifying-glass"></i> is not a "Pro Icon" so you can use it for free.
<i class="fa-regular fa-magnifying-glass"></i> is a "Pro Icon" so you cannot use it for free.

some font awesome show and some showing something wrong

<i class="fa fa-lg fa-eye" style="color:#007bff;"></i>
Please tell me the exact reason why this happen some font are showing while other show something else
Without your HTML it's hard to say why.
But, here is Font Awesome 6.12 working fine with fa-eye
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css" rel="stylesheet" />
<div>
<span class="fa fa-lg fa-pencil"></span>
<span class="fa fa-lg fa-box-archive"></span>
<span class="fa fa-lg fa-eye"></span>
</div>

fab fa-whatsapp appears in mobile device but i can't click on it

i have a problem with my fab fa-whatsapp font awesome. the problem is that it appears in desktop screen and i can click on it, it also appears in mobile screen but i can't click on it,on mobile screen it appears but it is not operating.here is my source code :
<div class="row">
<div class="col">
<i class="fab fa-whatsapp fa-5x" style="color:green;position:fixed;bottom:0;right:0"></i>
</div>
</div>
and here is the link tag :
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous">
thanks for your help.
Change HTML
<a style="position:fixed;bottom:0;right:0;display:inline-block;" href="https://api.whatsapp.com/send?phone=0701066555"><i class="fab fa-whatsapp fa-5x" style="color:green;"></i></a>

Font awesome with the class: fas fa-user gives pack a rectangle instead of a plus sign (+)

According to this page: https://fontawesome.com/icons/plus?style=solid
<i class="fas fa-plus"></i>
should give a plus sign (+)
And according to this page: https://fontawesome.com/icons/user?style=solid
<i class="fas fa-user"></i>
should give a user sign
Instead they both return a rectangle. What is going on here?
Works fine. Maybe you included the fontawesome css file incorrectly.
<link href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" rel="stylesheet"/>
<i class="fas fa-plus"></i>
<i class="fas fa-user"></i>
Look up for fas in the css loaded in your browser. You should see the diff

Space between link and icon, fontawesome

What's the best way to get a space between the link/paragraph and the icon?
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-reply"></i>Change
Doesn't work to just put a space before the text because it will be changed back when you minify/uglify the project.
I tried with all kinds of padding and margins. Can't get them to separate.
I would use the .fa-fw class. For example: <i class="fa fa-cog fa-fw"> This adds a visual space (that won't get stripped out) and it's consistent, so when/if the elements stack it looks a lot better.
Instructions: https://fontawesome.com/how-to-use/on-the-web/styling/fixed-width-icons
Don't know if is the best but you can add some margin-right to the i element:
i {
margin-right: 10px;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-reply"></i>Change
Old question but I didn't liked any of these answers so I did it this way:
<i class="fa fa-cloud"></i> <span class="ml-1">Resume</span>
I kinda hate CSS or dirty html and I prefer working only with classes but fa-fw isn't useful with some icons. Not sure if span is the way to go but it looks good in my project.
So you can just wrap your text around something and give it a margin in which direction you want.
I guess i is display: inline so you'll have to set its display to inline-block for margin-right to work :
i {
display: inline-block;
margin-right: 1em;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-reply"></i>Change
There are 2 spaces you need to add to make the UI look good. First, before the icon and a little space in between the icon and the text field.
So for the first case you need to add a font awesome class
fa-fw
class. for the second case, we just need a Non-Breaking Space.
&nbsp
This way you will not need an extra class to be added.
Below is a sample code to explain this.
<div class="list-group">
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw" aria-hidden="true"></i> Home</a>
<a class="list-group-item" href="#"><i class="fa fa-book fa-fw" aria-hidden="true"></i> Library</a>
<a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Applications</a>
<a class="list-group-item" href="#"><i class="fa fa-cog fa-fw" aria-hidden="true"></i> Settings</a>
</div>
Since I just came across the same question I took a closer look at Christina's suggestion from the font-awesome example page (sorry, I'm not allowed to just comment yet).
<div class="list-group">
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw" aria-hidden="true"></i> Home</a>
<a class="list-group-item" href="#"><i class="fa fa-book fa-fw" aria-hidden="true"></i> Library</a>
<a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Applications</a>
<a class="list-group-item" href="#"><i class="fa fa-cog fa-fw" aria-hidden="true"></i> Settings</a>
</div>
The most distance here is gained by (see screen 1) rather than from fa-fw see screen 2 since this is just unifying the width of the font-icon itself, so for a nicer look you may want to go for both.
(which will be interpreted as a space then) also should not make any troubles while minifying based on some quick tests.
Just use this:
a > i{
padding-right:10px;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-reply "></i>Change
<i class="fa fa-cloud mr-2"></i>
This integrates Bootstrap as well as does not require for any extra tags!
None of the answers here worked for me. I had to do this:
<i class="fa fa-reply"><span>Change</span></i>
i span {
display: inline-block;
margin-left: 0.3rem;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-reply" style="padding-right:5px"></i>Change
you can do inner css after -class="fa fa-reply"- put -style="padding-right:5px"-
note: if you doing more then one icon type the padding size will be different by 1 or -1 px
or just put a space before the word like this
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-
awesome.min.css" rel="stylesheet">
<i class="fa fa-reply"></i> Change