What could be causing my Font Awesome 6.1.1 icons to not show up after loading?

I'm currently enrolled in Brad Traversy's 50 Projects 50 Days course. On Day 26, which focuses on the Double Vertical Slider project, I noticed that the Font Awesome CDN being used is version 5.15.1, an outdated version. I have updated it to version 6.1.1, but for some reason, my icons are not loading despite various attempts to debug the issue. Specifically, I am looking to use the 'arrow-down' and 'arrow-up' icons within my 'down-button' and 'up-button' classes respectively.

Below is a snippet of my code:

@import url('https://fonts.googleapis.com/css?family=Open+Sans');
* {
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="shortcut icon" href="/favicon.ico" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer"
  />
  <link rel="stylesheet" href="style.css" />
  <title>Vertical Slider</title>
</head>

<body>
  <div class="slider-container">
    <div class="left-slide"></div>
    <div class="right-slide"></div>
    <div class="action-buttons">
      <button class="down-button">
          <i class="fa-solid fa-arrow-down"></i>
        </button>
      <button class="up-button">
          <i class="fa-solid fa-arrow-down"></i>
        </button>
    </div>
  </div>

  <script src="https://kit.fontawesome.com/3cff899477.js"></script>
  <script src="script.js"></script>
</body>

</html>

Thank You!

Answer №1

Your original integrity code was not up to standard. To rectify this, simply replace it with a freshly generated link from

IMPORTANT: DO NOT OMIT THE INTEGRITY ATTRIBUTE For a comprehensive explanation on why this attribute is crucial, please refer to:

@import url('https://fonts.googleapis.com/css?family=Open+Sans');
* {
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

.down-button {
  display: block;
  width: fit-content;
  height: fit-content;
  padding: 2rem;
  margin: 0 auto 1rem auto;
}

.up-button {
  display: block;
  width: fit-content;
  height: fit-content;
  padding: 2rem;
  margin: 0 auto 1rem auto;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="shortcut icon" href="/favicon.ico" />
  <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"
  />
  <link rel="stylesheet" href="style.css" />
  <title>Vertical Slider</title>
</head>

<body>
  <div class="slider-container">
    <div class="left-slide"></div>
    <div class="right-slide"></div>
    <div class="action-buttons">
      <button class="down-button">
          <i class="fa-solid fa-arrow-down"></i>
        </button>
      <button class="up-button">
          <i class="fa-solid fa-arrow-up"></i>
        </button>
    </div>
  </div>

  <script src="https://kit.fontawesome.com/3cff899477.js"></script>
  <script src="script.js"></script>
</body>

</html>

Answer №2

No longer do you have to download any files from Font Awesome – now you can use the kit instead. Simply follow these steps: 1. Visit the website. 2. Sign in. 3. Access your kit in your Gmail inbox (kit is JavaScript code). 4. Insert the code into your HTML file's title. That's all it takes! Only...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The process of dynamically inserting input types into a <td> element using the innerHTML tag is not functioning properly in Internet Explorer

I am facing an issue with dynamically placing input types within a <td> tag - the innerHTML() method is not functioning properly in Internet Explorer, although it works fine in Mozilla. This is how I am inserting the input types using JavaScript, wi ...

Automating item selection using Selenium in Python

Currently, I am in the process of developing a software program to automate web database management. However, I have encountered an issue while trying to manipulate a table where I need to arrange the items based on one of the columns by clicking on the co ...

Guide to creating a custom wrapper for a Material UI component with React JS

I am utilizing the Material UI next library for my project and currently working with the List component. Due to the beta version of the library, some parameter names are subject to change. To prevent any future issues, I have decided to create a wrapper a ...

HTML and JavaScript code to desaturate or grayscale image rollovers without the need for additional image duplicates or sprites

Is there a way to achieve grayscale to color image rollover effects without duplicating images or using sprites? I'm looking for an alternative technique that can accomplish this. Any suggestions on how to implement it? ...

Verify if the button is assigned a specific class, then generate a 'completed' div

I'm new to working with Jquery and I have a question. In my upload form, when something is uploaded the upload-button changes class from: <a class="upload-button upload buy" id="upload-button"><span>Upload a document</span></a> ...

Using both PHP and HTML to create a select tag

I'm new to PHP and HTML and I'm trying to create a form with three drop-down lists (select tags). However, when I select an option from one list, the values in the other two lists disappear. Should I save the selected values when submitting the f ...

Contrast in spacing: comparing display block versus inline-block

Today, I stumbled upon something quite intriguing that has left me puzzled. Consider the following HTML: <div class="a"><div class="b"></div></div> And CSS: .a { background: blue; } .b { display:inline-block; height ...

What steps do I need to take to create an animation where an outline gradually becomes filled in

I've been experimenting with creating a loading animation inspired by the pre-loading animation on this website. My attempt using chat GPT resulted in an unexpected outcome where, instead of filling the SVG, it placed a black square on top of it. The ...

Updating View in Angular 2 ngClass Issue

I'm encountering some challenges with updating my view using ngClass despite the back end updating correctly. Below is my controller: @Component({ selector: 'show-hide-table', template: ' <table> <thead> ...

Eliminate any unnecessary zeros at the end of a number within AngularJS interpolation

Although there are solutions available for plain JavaScript code, unfortunately they are not applicable in this particular scenario. I have a table that needs to be populated with data. The current code snippet is as follows: <tr ng-repeat="rows in $ ...

The sequence of loading styles is respected, yet Bootstrap continues to take precedence over the WordPress child

After putting together a WordPress child theme that correctly displays Bootstrap and child-styles.css in the source code, I encountered an issue: View Source Code Stylesheet Order Upon inspecting with Chrome, it's apparent that the color of my link ...

Issue with Bootstrap 5 offcanvas when placed inside a fixed div

I am currently incorporating the bootstrap navbar with offcanvas functionality. All nested within a fixed positioned div. The styling of the div is outlined below: .whiteHeader { position: fixed; display: flex; align-items: center; height: ...

Web Development: Custom Search Form

I am looking to create a website with a form similar to this one, but I'm struggling to figure out how to incorporate all three components into a single form using only HTML and CSS - no javascript. Do you have any suggestions or advice on how to achi ...

Discover the art of concurrently listening to both an event and a timer in JavaScript

Upon loading the page, a timer with an unpredictable duration initiates. I aim to activate certain actions when the countdown ends and the user presses a button. Note: The action will only commence if both conditions are met simultaneously. Note 2: To cl ...

How come it is not possible for me to choose all elements containing an attribute value saved in a variable?

Imagine you have the following snippet of HTML code: <div data-id=5>...</div> <img data-id=5 src=...> <input data-id=5 ...> ... Your task is to select and remove all elements with the attribute data-id set to 5. Here is one attemp ...

In Mobile View, I want to swap out my current image for text to keep it hidden

I am attempting to include text that is only visible in Mobile View as a replacement for my logo. Below is the code I am using: CSS: @media only screen and (max-width:1024px) { header .logo { display: none; } header .logo a { display: non ...

Fixing content at the bottom inside a container with Bootstrap 4

My app is contained within a <div class="container">. Inside this container, I have an editor and some buttons that I always want to be displayed at the bottom of the screen. Here's how it looks: <div class="container> // content here.. ...

What is the method for adding/removing the 'hidden' attribute within a <p hidden> element

What is the best way to toggle the visibility of 'hidden' in the element <p hidden>My Text</p>? I attempted removing the attribute and setting it to false, but unfortunately, neither method seemed to work. let paragraphElements = d ...

Include an Open OnClick event in the React/JSX script

We have a dynamic menu created using JavaScript (React/JSX) that opens on hover due to styling. My inquiries are: Instead of relying on CSS for the hover effect, where in the code can I implement an OnClick event to trigger the menu opening using Java ...

The functionality of DataTables is not supported on Internet Explorer versions 8 and below

My current setup involves using DataTables to present data in a tabular format with pagination and sorting functionalities. While this is working smoothly across all browsers, I have encountered an issue specifically in IE versions 8 and below. According t ...