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.

Target all elements in container on hover

  • Hello,

    I want to change the background color of a button and its icon in a container when hovering over this container (like here: https://postimg.cc/0McMgXJD).
    I tried with Generateblocks Pro but the color only changes when you hover over the button, not the whole container. I found a way to do this with CSS classes, but I’m not sure I’m doing the right thing.

    I added the hover-container CSS class to my container and 2 CSS classes to the button (hover-button hover-icon) and then added this code:

    .hover-container:hover .hover-button {
      background-color: var(--global-color-9);
    }
    .hover-container:hover .hover-icon {
      color: white;
    }

    Is this the right way to do it? Or is there a way to do this without CSS classes in Generateblocks?

    Thanks!

  • Hi there,

    Using the CSS you attached is the way to go, there’s no way to achieve this without CSS unfortunately.

    Only if the effect can be achieved by the Effect panel, otherwise CSS is required.

  • Perfect, thank you!

  • You are welcome 🙂

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