Archived topic
Add link to container
10 replies · Started by Viktor on March 22, 2022
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?
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 :)
Yes!
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! :)
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?
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.
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.
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.
Thank you Ying, I was looking for a solution like that :)
No problem :)
Can be deleted :) got it to work already