Site logo

[Resolved] Add link to container

Home Forums Support [Resolved] Add link to container

Home Forums Support Add link to container

  • This topic has 10 replies, 6 voices, and was last updated 3 years ago by Christopher.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2163974
    Viktor

    Hi,

    I have a container with a background image that I would like to add a link to, how do I do this? Can I add a css with specific url and then assign the css class to the box or is there another smart way of adding a link to the container?

    #2163991
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the page in question?

    You can use the private information field:
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know 🙂

    #2164381
    Viktor

    Yes!

    #2164386
    Fernando
    Customer Support

    Hi Viktor,

    Adding links to a Container Block is a functionality available through GenerateBlocks Pro: https://docs.generateblocks.com/article/container-links/

    Otherwise, you would need custom code, specifically, Javascript.

    Hope this clarifies! 🙂

    #2164395
    Viktor

    Really, you can’t put a html link in a container? Is there no way to add a H1 and make it transparent or give add a css class with url and then add it to the container?

    #2164581
    David
    Staff
    Customer Support

    Hi there.

    try this:

    1. Select the Container Block and in Advanced > Additional CSS Class(es) add: linked-container
    2. Inside the Container select one block eg. Headline and add your link to that.
    3. Add this CSS:

    .gb-container.linked-container .gb-inside-container {
        position: relative;
    }
    
    .gb-container.linked-container a:before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10;
    }

    This will extend the ‘clickable zone’ of the link to the size of the container it sits within.

    #2165183
    Viktor

    How do I add a headline without anything showing? I only have the image and if I add a headline with a link I need to add sone type of text. Also tried html but didn’t work either.

    #2165252
    Ying
    Staff
    Customer Support

    Looking at your design, why not use the image block with a link instead of the background image?

    Or you can add a headline block, give it a CSS class, use opacity:0; to hide it.

    #2165626
    Viktor

    Thank you Ying, I was looking for a solution like that 🙂

    #2166190
    Ying
    Staff
    Customer Support

    No problem 🙂

    #2323169
    Christopher

    Can be deleted 🙂 got it to work already

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