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.