ddunaway Posted August 7, 2023 Share Posted August 7, 2023 Hey there! I have the Blog Title and Blog Excerpt to show/hide on hover which works perfectly. The issue when the excerpt shows on hover if it requires two lines it shifts all the other posts below it down which I think looks bad. Could someone help me determine the best way to prevent that shift from happening? One solution could be to force ellipsis if there is a line break. /*Hide Excerpt*/ .blog-basic-grid article .blog-basic-grid--text { .blog-excerpt{ display: none !important; } } /*Hide Title and Show Excerpt*/ .blog-basic-grid article:hover .blog-basic-grid--text { .blog-title{ display: none !important; } .blog-excerpt{ display: inherit !important; } } @tuanphan @Ziggy Link to comment
ddunaway Posted August 7, 2023 Author Share Posted August 7, 2023 Website is https://www.hyperset.studio/ and you can see the hover line shift on the Lummi entry. Link to comment
Solution Ziggy Posted August 8, 2023 Solution Share Posted August 8, 2023 This is what you need to clamp the text to one line: .blog-basic-grid .blog-excerpt p { margin: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; } ddunaway, Begona and tuanphan 3 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) 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
ddunaway Posted August 8, 2023 Author Share Posted August 8, 2023 Thank you @Ziggy! Ziggy 1 Link to comment
JulieChristina Posted October 11, 2023 Share Posted October 11, 2023 Hello, I was wondering how to apply this to certain text blocks (all miscellaneous font) on mobile if they are in a page and not a blog post? I've built a page of images with descriptions underneath. On desktop they look great but on mobile I want an ellipsis instead of spilling into a second line. Thanks. website: https://www.holidayst.com/south-pacific password: bonvoyage Link to comment
tuanphan Posted October 15, 2023 Share Posted October 15, 2023 On 10/12/2023 at 1:02 AM, JulieChristina said: Hello, I was wondering how to apply this to certain text blocks (all miscellaneous font) on mobile if they are in a page and not a blog post? I've built a page of images with descriptions underneath. On desktop they look great but on mobile I want an ellipsis instead of spilling into a second line. Thanks. website: https://www.holidayst.com/south-pacific password: bonvoyage You mean all text under product images on this page? 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment