Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Add H2 Margin Top

  • Hello,

    I have added pages like About Us and Contact Us on my website. I want to add a margin-top for H2, but I can’t find any settings as I can only see the margin-bottom in typography.

    I am using the following code:

    h2 {
        margin-top: 60px;
    }

    Kindly let me know the correct CSS, as this one is not working.

  • Hi there,

    that CSS should work as long as there is no other CSS that is overwriting it, and the element before it does not have larger bottom margin.

    Can you share a link to where i can see it on your site ?

  • Thanks for the quick reply.

    I have attached the link in private for you to check:

  • Ok, that CSS should work ok.
    Where did you add the CSS?

    NOTE: In your child theme styles.css you have this:

    add_filter( 'generate_editor_styles', function( $editor_styles ) {
        $editor_styles[] = 'style.css';
    
        return $editor_styles;
    } );

    That needs to be moved to your functions.php as it is PHP.

  • Thanks, I had mistakenly used the above code in CSS and that was the issue.

    It’s working now thanks.

  • Glad to hear that!

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