Here is the code inside head tag:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin="anonymous">
In console I'm getting the following:
GET https://use.fontawesome.com/releases/v5.7.1/css/all.css net::ERR_NAME_NOT_RESOLVED
How to solve this?
Maybe problem with your network.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin="anonymous">
<i class="fas fa-user-edit"></i>
Related
<link rel="stylesheet" href=b oxwebpage.css>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/fontawesome.css" />
<div class="ram">
<i class="fa-regular fa-info"></i>
</div>
I have no idea how to fix it just shows empty box?
<i class="fa-regular fa-info"></i> is a pro icon, so if you don't have a subscription with FA then it's not going to display for you even if you try to use a different CDN (it'll show an X or nothing at all)
https://fontawesome.com/icons/info?s=regular
I switched it out with solid, they basically look the same but if you absolutely have to have the pro version then you'll have to shell out for it: https://fontawesome.com/plans
<link rel="stylesheet" href=b oxwebpage.css>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<div class="ram">
<i class="fa-solid fa-info"></i>
</div>
You could also cheat it by adding a -webkit-text-stroke: 1px black; (FA icons can be treated as classes) but it's a non-standard feature according to MDN but I think the only people you'll be leaving out are IE users
.fa-info {
font-size: 20px;
-webkit-text-stroke: 1px black;
}
<link rel="stylesheet" href=boxwebpage.css>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<div class="ram">
<i class="fa-solid fa-info"></i>
</div>
Use the following cdn and remove regular from class:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="ram">
<i class="fa fa-info"></i>
</div>
I am trying to use font awesome in my project.
I have followed the instructions on their website on how to download it directly and use it within my project.
Here is how I have included it in my link tags.
<link rel="stylesheet" href="vendors/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/css/MarkerCluster.css">
<link rel="stylesheet" href="vendors/css/MarkerCluster.Default.css">
<link rel="stylesheet" href="vendors/css/font-awesome.css" />
<link rel="stylesheet" href="vendors/leafletJs/leaflet.css" />
<link rel="stylesheet" href="vendors/css/easy-button.css" />
<link rel="stylesheet" href="vendors/css/leaflet.extra-markers.min.css">
<link rel="stylesheet" href="libs/css/style.css">
My code:
<td class="boldFont"><i class="fas fas-camera-retro fas-lg"></i>Region:</td>
<td id="region"></td>
</tr>
<tr>
<td class="boldFont"><i class="fas fas-camera-retro fas-lg"></i>Subregion:</td>
<td id="sub-region"></td>
</tr>
<tr>
<td class="boldFont"><i class="fas fa-adjust"></i>Population:</td>
<td id="population"></td>
</tr>
2 of the three are showing nothing, whilst one of them shows an empty little box (image below)
What am I doing wrong here exactly?
//UPDATE//
Also, when I add a './' at the beginning of the path I get this message:
"GET http://localhost:8090/project1/vendors/webfonts/fa-solid-900.woff net::ERR_ABORTED 404 (Not Found)".
I am not sure if its worth mentioning, but I am running this on XAMPP. Could that have anything to do with it?
You should place ./ at the beginning of href.
<link rel="stylesheet" href="./vendors/css/bootstrap.min.css">
<link rel="stylesheet" href="./vendors/css/MarkerCluster.css">
<link rel="stylesheet" href="./vendors/css/MarkerCluster.Default.css">
<link rel="stylesheet" href="./vendors/css/font-awesome.css" />
<link rel="stylesheet" href="./vendors/leafletJs/leaflet.css" />
<link rel="stylesheet" href="./vendors/css/easy-button.css" />
<link rel="stylesheet" href="./vendors/css/leaflet.extra-markers.min.css">
<link rel="stylesheet" href="./libs/css/style.css">
Because a path to the css files in your case is read from the index.html file
Example of directories
XAMMP
Try to see if XAMMP will go 1 directory
<link rel="stylesheet" href="/vendors/css/bootstrap.min.css">
Or
<link rel="stylesheet" href="../vendors/css/bootstrap.min.css">
I am linking to the bootstrap get started CSS and I have a personal main.css. I've linked the boostrap as specified in the getting started instructions, however my custom css only works if I put a <style> tag in the index.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>Lunix</title>
</head>
<body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>
Order out of order
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="main.css">
You have to add Your custom css file link always in last of your all links so, it will work fine.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="main.css">
You have to first link bootstrap css and then your custom css which is main.css
So that you will get bootstrap css first and then your custom css will get rendered and your css will be applied. Also if you want to change custom class css of bootstrap (which you should avoid to do) you can use !important and it will work.
Change :-
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
Change with :-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="main.css">
add your custom css main.css after the boostrap css file
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="main.css">
Project
Can anyone help me how to include fontawesome in the html5 and css 3 project?
You need to pick a desired version and pack at their Start page and include a tag into section of your page, e.g.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
Other ways of installing it listed on same page.
Here is a working example:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<span style="font-size: 3em; color: Tomato;">
<i class="fas fa-igloo"></i>
</span>
Just started using font-awesome and all my images appear as squares if I use the font-awesome css locally. My code is straightforward:
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap.css" />
<link rel="stylesheet" type="text/css" href="daterangepicker-bs3.css" />
<link rel="stylesheet" type="text/css" href="font-awesome.css"/>
</head>
<i class="fa fa-truck"></i>truck
I put the font files in ../fonts/ as it says in the font-awesome.css. I also put the fa which is particular to version 4.0, and I also tried the CDN. However, with the CDN, I don't even get a square, I just get a blank. Anyone have any idea?
Thanks!