How to connect custom fonts to your site

How it works

If you don't want to use the default fonts available in Site Builder, you can connect different fonts from the Google Fonts catalogue for headers or body text via a custom HTML code. You may use an existing solution or write your own code.

How to get it

Using an existing solution

  1. Go to Publisher Account > Site Builder.
  2. Insert the font’s URL into the Custom code block and specify the style classes for which the font-family value should be changed.

Example of changing the header font

Copy
Full screen
Small screen
<style>
@import url('https://fonts.googleapis.com/css?family=Playfair+Display&display=swap');

  .custom-header-font h1,
  .custom-header-font h2,
  .custom-header-font h3,
  .custom-header-font h4,
  .custom-header-font h5,
  .custom-header-font h6 {
    font-family: 'Playfair Display';
  }
</style>

Example of changing the body text font

Copy
Full screen
Small screen
<style>
  @import url('https://fonts.googleapis.com/css?family=Playfair+Display&display=swap');

  .custom-main-font {
    font-family: 'Playfair Display';
  }
</style>

  1. Click Preview to see your changes.

Watch the tutorial video for this instruction:


Writing your own code

If you want to use your own code:

  1. Go to Publisher Account > Site Builder.
  2. Insert the code to the Custom code block.
  3. Click Preview to see your changes.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We're sorry to hear that
Please explain why this article wasn't helpful to you. Message
Thank you for your feedback!
We'll review your message and use it to help us improve your experience.

Continue reading