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.

Custom CSS changes for H2 left/right padding

  • Hi, I have the following custom CSS to add a colored background over H2 headings with padding above / below. However, if I try to put padding-left: 20px & padding-right: 20px, it doesn’t work and shifts the text to the left instead of centering it. Am I missing something?

    /*Add colored background to H2 headings*/
    .single-post h2 {
    background-color: #AEDE82;
    padding-top: 25px;
    padding-bottom: 25px;
    text-align: center;
    }

    Thanks

  • Hi there,

    can you share a link to where i can see this H2?

  • Hi, Yes you can see it on the following page. It’s the mobile version that required the left / right padding mainly. https://makemesustainable.com/sustainable-flower-delivery/

  • Try this:

    .single-post h2 {
        background-color: #aede82;
        padding: 25px 10px;
        text-align: center;
    }

    If that causes an issue, leave the CSS in place and let me know.

  • Fixed, thanks.

  • Glad to hear that!

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