- This topic has 7 replies, 3 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
January 31, 2023 at 12:10 pm #2516109
Gerrit
Hi,
I would like to have the post title and excerpt to be shown on hover as an overlay. Something like this: https://lovstaddesign.no/#prosjekter I am working with a site offline, using the query loop function.
For now I have the post title and excerpt below the featured image. How do I fix this?
Thanks?
January 31, 2023 at 12:43 pm #2516161Ying
StaffCustomer SupportHi Gerrit,
This will require some custom CSS.
Before adding the custom CSS, you need to create:
1. A container block with its background image set to the featured image.
2. Add another container block inside it, set the background color and add the content you want to the child container.Once that’s done, we can have another look and write the custom CSS for you.
Let me know 🙂
February 1, 2023 at 12:01 am #2516623Gerrit
Ok thank you, I have done so. What css code do I need to use?
February 1, 2023 at 1:26 am #2516689Fernando Customer Support
Hi Gerrit,
Can you also share the link to the specific page where you’ve created this structure? If it’s still in your local testing site, can you create a static page we can view and paste the structure there? We’ll provide the CSS after we see it live.
February 1, 2023 at 6:13 am #2516967Gerrit
Here is link to the page, it is now live: https://lovstaddesign.no
February 1, 2023 at 11:26 am #2517443Ying
StaffCustomer SupportTry adding this CSS:
.gb-container.gb-container-8407c2fd { opacity: 0; transition:all 0.3s ease; flex: 1; } .gb-container.gb-container-50b02063:hover .gb-container.gb-container-8407c2fd { opacity:1; } .gb-container.gb-container-50b02063 > .gb-inside-container { height: 100%; display: flex; flex-direction: column; }The CSS is using the GB block’s unique ID, if the blocks are removed and re-added, the ID will change, the CSS will not work anymore.
So I would recommend adding CSS class to the parent container which has the background image, eg.
bg-img-container, to replace thegb-container-50b02063in my code.And add another CSS class to the child container which has the content and background color, eg.
content-containerto replace thegb-container-8407c2fdin my code.https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/
February 1, 2023 at 10:27 pm #2517923Gerrit
Thank you, that worked perfect.
February 2, 2023 at 10:24 am #2518874Ying
StaffCustomer SupportNo Problem, glad to help 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.