petra Posted July 10, 2023 Share Posted July 10, 2023 Hi! Trying to use custom css to add a hover over effect on a masonary grid gallery. Everything working ace EXCEPT, when the caption copy runs over to two lines, it changes from center to left align 😞 Here's the code - any ideas? I can't add any code to head tag as the subscription level my friend has isn't high enough. /* gallery Hover effect */ figure.gallery-masonry-item { position: relative; } .gallery-caption { position: static; } /* title */ .gallery-caption-content { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; z-index: 999; padding: 7%; transition: opacity ease 200ms !important; opacity: 0 !important; pointer-events: none; } .gallery-masonry-item:hover .gallery-caption-content { opacity: 1 !important; font-size: 30px !important; color: #FFFFFF; } /* overlay */ .gallery-masonry-item-wrapper a:after { background: #000000; /* overlay color */ content: ""; display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity ease 200ms !important; } .gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after { opacity: 0.75; } /* remove gap */ figcaption { padding: 0 !important; } Link to comment
Ziggy Posted July 10, 2023 Share Posted July 10, 2023 Can you share your website URL and this page? Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
petra Posted July 10, 2023 Author Share Posted July 10, 2023 Hi! Here it is 🙂 https://recorder-smilodon-sgbl.squarespace.com/home-concept Ziggy 1 Link to comment
Solution Ziggy Posted July 10, 2023 Solution Share Posted July 10, 2023 Try adding this: .gallery-caption-content { text-align:center; } tuanphan 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
petra Posted July 10, 2023 Author Share Posted July 10, 2023 Thank you so much for that Ziggy! Ziggy 1 Link to comment
christined Posted March 20 Share Posted March 20 Hi, all. I implemented the CSS in this thread but have a couple issues - when I am not hovering over image, I can see a faint/small version of the caption on the image (see screenshot) Mobile - I know hover doesn't work on mobile screens, so what CSS do I need to add to always display caption (beneath image) on mobile? I need a I experimented with several solutions found on various posts, but don't have it working yet. I am using Masonry Grid in portfolio pages. angelaart.net/work pw angela @Ziggy, anyone -- have any advice for how to tweak my css to resolve these things? Thanks for any help you can offer! Christine Link to comment
tuanphan Posted March 25 Share Posted March 25 On 3/21/2024 at 2:17 AM, christined said: Hi, all. I implemented the CSS in this thread but have a couple issues - when I am not hovering over image, I can see a faint/small version of the caption on the image (see screenshot) Mobile - I know hover doesn't work on mobile screens, so what CSS do I need to add to always display caption (beneath image) on mobile? I need a I experimented with several solutions found on various posts, but don't have it working yet. I am using Masonry Grid in portfolio pages. angelaart.net/work pw angela anyone -- have any advice for how to tweak my css to resolve these things? Thanks for any help you can offer! Christine For masonry under Installs text? I see you disabled Gallery Caption, can you enable it & add some captions? Then we can check problem easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
christined Posted March 30 Share Posted March 30 On 3/25/2024 at 5:11 AM, tuanphan said: For masonry under Installs text? I see you disabled Gallery Caption, can you enable it & add some captions? Then we can check problem easier Hi, @tuanphan. Thanks for your reply. I solved this issue with help from someone in another post. I did just reply to another post of yours about a separate issue with Mobile padding and image width on that "Installs" masonry gallery, in case you have any ideas about that. 🙂 Thanks for being such a present and helpful member of this community!! Your posts have helped me countless times. Link to comment
christined Posted March 30 Share Posted March 30 In case it can help someone else -- I solved my issue with suggested solution in this post: tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment