0

I am trying to include FontAwesome to an ::before-element. The include to the website worked (I have other Icons in an i-element on the website) but the unicode-way won't work.

I've trying to add an icon for the previous-button in fontAwesome like that:

    .owl-carousel .owl-nav button.owl-next, .owl-carousel .owl-nav button.owl-prev, .owl-carousel button.owl-dot {
    font-family: "fontAwesome";
}

.owl-carousel .owl-nav .owl-prev::before{
    content: "\f053";
    font-family: FontAwesome;
    margin-right:10px;
}

But it just shows up like that:

Error

I tested adding height and width, making it a block-element.. nothing seems to work. I am using the Contao CMS.

7
  • Which version of fontawesome are you using? The new version requires you to set the weight which is different per glyph, for chevron left that'sfont-weight: bold; Commented Aug 21, 2020 at 13:21
  • @AlexanderDeSousa I'm using version 5 and tried it with hte font-weight, but there's no change.
    – Tobi Smith
    Commented Aug 21, 2020 at 13:23
  • @AlexanderDeSousa You can check that here: vacationy.siteholder.de (Bottom)
    – Tobi Smith
    Commented Aug 21, 2020 at 13:24
  • When I insert <i class="fas fa-chevron-left"></i> before your button via dev tools and then inspect it, it shows the font-family for the i element as "Font Awesome 5 Free" - you used FontAwesome for your button ::before element instead.
    – CBroe
    Commented Aug 21, 2020 at 13:30
  • I have FontAwesome installed locally so my computer is finding and displaying the right icon, it feels like you're missing the font on your site, are you sure you're including it? Commented Aug 21, 2020 at 13:30

1 Answer 1

0

When I insert <i class="fas fa-chevron-left"></i> before your button via dev tools and then inspect it, it shows the font-family for the i element as "Font Awesome 5 Free" - you used FontAwesome for your button ::before element instead.

Not the answer you're looking for? Browse other questions tagged or ask your own question.