- This topic has 9 replies, 4 voices, and was last updated 1 year, 7 months ago by
Tom.
-
AuthorPosts
-
November 30, 2020 at 11:53 am #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
November 30, 2020 at 3:28 pm #1559403Elvin
StaffCustomer SupportHi,
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-1481880A wise man once said:
"Have you cleared your cache?"December 1, 2020 at 1:58 am #1559982Carlo
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 containerThank you. Carlo
December 1, 2020 at 4:45 am #1560208David
StaffCustomer SupportHi there,
change this:
.gb-container.clickable-container .gb-inside-container { position: initial; }
to:
.gb-container.clickable-container > .gb-inside-container { position: relative; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 1, 2020 at 5:35 am #1560254Carlo
Thank you David, it works!
Is it possible to make the svg icons in those containers change color on hover as well?
i.e. redDecember 1, 2020 at 6:18 am #1560321David
StaffCustomer SupportYou’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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 1, 2020 at 8:24 am #1560760Carlo
Great, I have just modified them (I hope I did it right)
What’s the css to add? πDecember 1, 2020 at 1:00 pm #1562036Tom
Lead DeveloperLead DeveloperHi there,
You can do something like this:
.clickable-container:hover .gb-icon { color: red; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 2, 2020 at 9:32 am #1564143Carlo
It works. Thank you guys π
December 2, 2020 at 10:06 am #1564212Tom
Lead DeveloperLead DeveloperYou’re welcome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.