Home >Web Front-end >CSS Tutorial >Why Isn't My Font Awesome 5 Icon Showing?

Why Isn't My Font Awesome 5 Icon Showing?

Patricia Arquette
Patricia ArquetteOriginal
2024-12-10 10:50:131017browse

Why Isn't My Font Awesome 5 Icon Showing?

Why is Font Awesome 5 CSS Content Not Showing?

When attempting to utilize Font Awesome CSS content, users may encounter an issue where only the icon code appears instead of the desired icon. This can be resolved by addressing both the font-family and content attributes.

Font-family Correction

In the provided code snippet, the font-family attribute is incorrectly set as 'FontAwesome'. The correct font-family for Font Awesome 5 Free is:

font-family: "Font Awesome 5 Free";

Content Correction

The content attribute is missing a leading backslash ''. Instead of /f35a, it should be:

content: '\f35a';

Here is the updated code with the corrections applied:

@import url("https://use.fontawesome.com/releases/v5.13.0/css/all.css");

.fp-prev:before {
    color:#000;
    content: '\f35a';
    font-family: "Font Awesome 5 Free";
    font-style: normal;
    font-weight: normal;
}

By making these corrections, the Font Awesome icon should now display properly.

The above is the detailed content of Why Isn't My Font Awesome 5 Icon Showing?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn