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.

.gb-container vs .gb-element-id

  • Hi team,

    in my style.css I have a CSS instruction that is often used and is very helpful.

    /* remove bottom margin on last paragraph or list in container */
    .gb-container p:last-child:last-of-type,
    .gb-container ul:last-child:last-of-type {
      margin-bottom: 0px;
    }

    Unfortunately, it no longer works with v2 🥴

    There is no more .gb-container. Instead, the containers are now suddenly called .gb-element.

    I can’t use the CSS because .gb-element no longer exists as a single class. It is now always associated with an id.

    What can I do to replace the CSS, so that it works with v2?

    Thank you!

  • Hi there,

    You can use

    [class^="gb-element-"]  p:last-child:last-of-type, [class^="gb-element-"] ul:last-child:last-of-type {
      margin-bottom: 0px;
    }

    Or create a global style for it.

  • Thank you very much, Ying, that helps 👍!

    Unfortunately, I have a similar problem with the buttons.
    I used to address the buttons with .gb-button, but this class no longer seems to exist.
    Instead, the buttons now have the class .gb-text, right?
    But don’t all paragraphs also have the class gb-text?

    How would I then convert this style to v2?

    /* GB button line height override */
    .gb-button {
    	line-height: 1.5em;
    }
  • Yes, button is the same as text block, only with tag being a instead of p, h1, h2 etc.

    You can use a.gb-text to target the button.

  • Yes of course, that’s it!

    Thank you !!

  • You are welcome   🙂

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