Site logo

[Support request] How to mix different fonts in one headline?

Home Forums Support [Support request] How to mix different fonts in one headline?

Home Forums Support How to mix different fonts in one headline?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1957019
    Sascha

    Hi

    I need to replicate my new clients current site with a new site created with GenerateBlocks. The current headline contains 2 fonts.

    Is it possible to use 2 fonts in 1 headline using the GB-headline-block? If not, how can I replicate the headline? Need to use a grid?

    Thank you in advance and kind regards,
    Sascha

    #1957327
    David
    Staff
    Customer Support

    Hi there,

    If you have 1 x Headline for the Blue text, and a separate Headline for the Orange text then you could style the Orange text using the Highlight text option.

    1. Add the orange text to your headline.
    2. With the block selected in Advanced > Additional CSS Class(es) add: custom-higlight
    3. Select the text you want for in the different font, and from the Toolbar dropdown menu select Hightlight.
    This will add the gb-highlight class to that text.
    4. Use some CSS to change the font:

    .custom-highlight .gb-highlight {
        font-family: 'your font here';
    }

    You will need to make sure that highlight font is being loaded on your site.

    #1970570
    Sascha

    Hello,

    thank you for your reply and your advice, that’s a very useful workaround!

    Unfortunately it does not work. I have followed your instruction, applied the CSS-Class to the Headline-Block, then added the CSS-declaration to the page via Simple-CSS metabox and replaced ‘your font here’ with the Sign Painter HouseScript Regular, highlighted the words inside the headline and updated the post. But the font has not been applied to the highlighted words.

    For testing purposes I have applied the font to another headline on the same page for checking any mistake and actually the font is loading correctly, as you can see on this screenshot.

    Furthermore, the headline does not only contain 2 fonts. It’s also applying 2 styles to the main-font, default color and orange, whereas the orange color needs to be applied to the 2nd font. I hope this screenshot helps to understand this better 🙂

    Any other tips about how to solve this? Just in case you would like to access the page via editor, please find the credentials applied as a Private information below.

    I have also recorded a screencast to illustrate how I have applied the instructions, you find the recording here.

    Thank you in advance and kind regards,
    Sascha

    #1970647
    David
    Staff
    Customer Support

    To have the three various styles means you would have to use a HTML block instead of the Headline. The HTML would look like this:

    <h1 class="my-custom-heading">This text is the default text style <span class="color">this text begins the color change <span class="font">this text is in other font </span>this is color text normal font</span></h1>

    And the CSS would be something like this:

    h1.my-custom-heading {
        font-weight: bold;
    }
    h1.my-custom-heading .color {
        color: #E84A1D;
    }
    h1.my-custom-heading .font {
        font-family: Sign Painter HouseScript Regular;
        font-size: 56px;
    }

    You can change the CSS selector: my-custom-heading to any unique name you want, but you must change it in the HTML and all instance of the CSS.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.