Custom font on section

Hi, 

I'm having a problem using a custom font in a single section only. 

I assigned a custom class at that section named truffle than I added the following CSS code to the theme in Custom CSS area:

.truffle h2{
  font-family: "Always forever",Arial,Tahoma,sans-serif !important;
}

I forgot to mention that I added the above font in custom fonts but it is not working, it just works setting it for ALL the headings line but I would need to use it in this heading only.

Could you please help me?

Thanks and best regards.

Christian

Comments

  • Hi,

    did you added all font files? Did you checked in the code if all fonts can be read properly?
  • Hi,

    when I wrote you I uploaded only the .ttf file but now I've uploaded all the remaining files and nothing changes.

    According to what I can see all the fonts can be read properly and if I use this through the theme settings it works; my problem is that I just want it in a single section only, that's why I'm adding a custom css for that section only.
  • If you want to use custom fonts for one section only, then you must upload all font files under Theme options > Fonts > Font Family section and then you must set these fonts with custom css for section.
  • Hi and thanks for your reply.

    What you suggest is the same I've done using the above code but it doesn't work.

    Is there something wrong in the css code I added (supposing that the name of the font is correct)?

    .truffle h2{
      font-family: "Always forever",Arial,Tahoma,sans-serif !important;
    }
  • Without url to site where you did it, we have no idea what could be wrong. Above css looks fine for us so the problem must be somewhere else.
  • Hi the the url of the site is http://www.tartufosavigno.com, just under the 3 buttons there's writen "Live Savigno Truffle" and this is the sentence I have to write with the above mentioned font.

    Thanks for your help
  • As we see, this does not work because Always forever font is not included nowhere. There is nothing like that in the code.
  • I'm not sure about what you mean exactly.

    What I've done is the following:

    - upload the font in different formats and set it into the BeTheme
    - assign a custom class "truffle" in the section I wanted
    - set the CSS rule as follows:
    .truffle h2{
      font-family: "Always forever",Arial,Tahoma,sans-serif !important;
    }

    That's it.

    Is there anything else I need to do?
  • Did you set the font name as well for custom font? If you did it, then please send us private message with access to your dashboard.
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.