Font Awesome icons 4.2.0 Minimal do not display - html

I'm trying to put a font awesome icons for my star rating.
I copy this below:
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css">
And put it in a page(font-awesome-4.2.0.min.css) this below:
<link rel="stylesheet" href="css/font-awesome-4.2.0.min.css">
This work well
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css">
But this do not work
<link rel="stylesheet" href="css/font-awesome-4.2.0.min.css">
How can I make this (In a webpage: font-awesome-4.2.0.min.css) to work so that my icons can display

You should keep the folder structure of font awesome and point to the css there. Moving around the files can cause issues because they could be using relative paths to link to their other source files. It should look something like this:
<link rel="stylesheet" type="text/css" href="./font-awesome/css/font-awesome.min.css">
I use font awesome in almost every project and have had very little issues. You can see their instructions here: https://fortawesome.github.io/Font-Awesome/get-started/

Related

How do I link my CSS to the HTML file in Github Pages?

I need some help here.. I tried different links but it does not load the CSS file..
<link rel="stylesheet" type="text/css"
href="https://github.com/cengizkirazjs.github.io/cengizkiraz.github.io/styles.css">
This is the page and the outcome: https://cengizkirazjs.github.io/cengizkiraz.github.io/
Any advice? Its my first time linking CSS with HTML on Github!
As it was said in the comments, what do you think about changing file path a bit?
In your code we have this line
<link rel="stylesheet" type="text/css" href="cengizkiraz.github.io/styles.css">
It contains an absolute path. If you want to stick to this method, maybe just add a protocol, like this
<link rel="stylesheet" type="text/css" href="https://cengizkiraz.github.io/styles.css">
But it would be better if you use relative paths
In this case, our <link> will look like this
<link rel="stylesheet" type="text/css" href="styles.css">
It means that HTML will search for this file in folder, where .html file is saved. Looks slightly better, doesn't it?

Bootstrap is overriding

I have this problem with a website I'm building. I'm trying to implement php code to connect to some external search engine but I found myself having some problems I can't fix. I realised somehow my bootstrap is overriding with the one from the server I want to implement it so it doesn't allow my web to find my style.css. I don't know if I'm making any sense. If anyone could have a look would be super great.
<link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/css/bootstrap.min.css?8656">
<link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/style.css?6959">
<link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/css/animate.min.css?2803">
<link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/css/ionicons.min.css">
Here are some pictures of my issue:
If I remove <link rel="stylesheet" type="text/css" href="http://lostonyouagency.com/css/bootstrap.min.css?8656"> all the external widgets will work but then I will face some serious problems on my menu bar. I don't know what else to do, I have tried quite a few things! Someone told me I need to edit the Css class but I don't know how to do it!
Also chrome is telling me it can find the assets/css/style.css.map
This is because you have 2 version of Bootstrap in your page. Bootstrap 4 and bootstrap 3.x
The first highlighted CSS has Bootstrap version 4. Second highlight has Bootstrap 3x inside it along with other styles.
This looks like a conflict between both versions and your styles.

FontAwesome icons are appearing as squares, how to fix?

I'm trying to use their CDN via the BootstrapCDN but that didn't work so I tried to register and get my own CDN but that doesn't work either, they both produce these squares instead of the icon.
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/MY-PERSONAL-ONE.css">
Here is what the icons look like
Edit: I ended up using the public one their website after I clicked 'Want to use Font Awesome without Font Awesome CDN?' and it worked..
Heres where that linked to: https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css
Use FontAwesome's CDN rather than Bootstrap's. I've actually had this exact issue previously with CDNs hosted by BootstrapCDN.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">

Font Awesome not working with HTML5 UP template

I'm trying to create a website using a template from HTML5 UP (Arcana). The structure of the template looks like this:
/assets
/assets/css
/assets/fonts
/assets/js
/assets/sass
/index.html
When not modifying anything, the template works as intended and all icons from Font Awesome are shown correctly (like here).
Now I want to structure my sites like this:
/assets
/assets/css
/assets/fonts
/assets/js
/assets/sass
/foo/page.html
/bar/page.html
/index.html
Now when I open /foo/page.html the style and Font Awesome icons are missing because the references to them are messed up.
<link rel="stylesheet" href="assets/css/main.css" />
<script src="assets/js/main.js"></script>
I tried to fix it like this:
<link rel="stylesheet" href="../assets/css/main.css" />
<script src="../assets/js/main.js"></script>
Now the style works again, but the Font Awesome icons are still shown as boxes.
I also tried including Font Awesome like this:
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
However, the icons still don't work.
Changing
to
doesn't work either.
Update: For some reason this doesn't work in Firefox, but it works in MS Edge without a problem.
old
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
new
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">

Zurb Foundation CSS not working when replacing CDN to Local

Can anyone tell me why; when I change the following path:
<link rel="stylesheet" href="http://dhbhdrzi4tiry.cloudfront.net/cdn/sites/foundation.min.css">
to:
<link rel="stylesheet" href="css/foundation.min.css">
the example portfolio page (https://foundation.zurb.com/templates-previews-sites-f6/portfolio.html) loses all of it's structure, even though the local CSS file exists?
Thanks.