[Resolved] Make these containers clickable

Home Forums Support [Resolved] Make these containers clickable

Home Forums Support Make these containers clickable

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1559091
    Carlo

    Hi there,

    I need to make the 2 containers (the one purple and the one green) on the right clickable. (or, I need them to be buttons, as you prefer :))

    I have tried some solutions in other topics but with no success.

    How can I do?

    Thank you.

    Best wishes. Carlo

    #1559403
    Elvin
    Staff
    Customer Support

    Hi,

    To make clickable containers from GB’s container block, you can follow David’s answer here:
    https://generatepress.com/forums/topic/how-would-i-make-a-clickable-container-with-gb/page/2/#post-1481880

    #1559982
    Carlo

    Hi Elvin,

    tried it.

    But Now the whole page hero is clickable while only each button is meant to be clickable.

    How could I fix it?

    What I did:
    added the following css:

    .gb-container.clickable-container a:before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 999;
    }
    
    .gb-container.clickable-container .gb-inside-container {
        position: initial;
    }

    added the class clickable-container to each clickable container

    Thank you. Carlo

    #1560208
    David
    Staff
    Customer Support

    Hi there,

    change this:

    .gb-container.clickable-container .gb-inside-container {
        position: initial;
    }

    to:

    .gb-container.clickable-container > .gb-inside-container {
        position: relative;
    }
    #1560254
    Carlo

    Thank you David, it works!
    Is it possible to make the svg icons in those containers change color on hover as well?
    i.e. red

    #1560321
    David
    Staff
    Customer Support

    You’re SVG icons contain their own inline CSS and CSS style sheets – you would need to edit the SVG remove the styles and the set its fill attribute to currentColor

    Then it can be styled with some CSS.

    #1560760
    Carlo

    Great, I have just modified them (I hope I did it right)
    What’s the css to add? πŸ™‚

    #1562036
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can do something like this:

    .clickable-container:hover .gb-icon {
        color: red;
    }
    #1564143
    Carlo

    It works. Thank you guys πŸ™‚

    #1564212
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

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