MattBairdSound Posted June 25, 2023 Posted June 25, 2023 Site: https://www.mattbairdsound.com/drama-1 Password: sound For each of the images in this gallery I'd like to make 4 lines of text appear when you mouse over. Is that possible? Thank you!
Solution MayaViolet Posted June 25, 2023 Solution Posted June 25, 2023 Hey @MattBairdSound - You should be able to use the gallery caption feature and some simple css to achieve this outcome. In order to differentiate the hover text from your current caption title text, you can wrap the hover text in html tags, so that we can target specifically this text. For example, if you have "Count Abdulla" in the caption already, add "<h2> hover text here </h2>" after in in the same line. Here's the CSS I would add: .gallery-caption-wrapper { overflow: visible; // this allows your hover text to be visible when we make it an absolute element, and move it up to appear on top of the image - if you want it to appear normally beneath the title, ignore this, and remove "position:absolute" below } .gallery-caption-wrapper h2 { position: absolute; text-align: center; width: 100% !important; transform: translateY(-250%); // this moves the text up - can be adjusted to match your needs margin: 0 !important; transition: .5s; // allows for smooth fade in/out when we adjust opacity opacity: 0; } .gallery-grid-item:hover { .gallery-caption-wrapper h2 { opacity: 1; transition: .5s; } .gallery-grid-item-wrapper img { opacity: 0.8; // changes opacity of image so text is more legible on hover } } Depending on where and how you want it to appear, the above can be adjusted. Hope this helps! tuanphan 1
MattBairdSound Posted June 27, 2023 Author Posted June 27, 2023 Thank you so much! is there a way to have a different transform % value for mobile?
tuanphan Posted June 28, 2023 Posted June 28, 2023 18 hours ago, MattBairdSound said: Thank you so much! is there a way to have a different transform % value for mobile? Add this code under /* code for mobile */ @media screen and (max-width:767px) { .gallery-caption-wrapper h2 { transform: translateY(-150%) !important; } } 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!)
MattBairdSound Posted June 30, 2023 Author Posted June 30, 2023 Thank you both very very much for your <h2> code! I've used <h3> and <h4> too for different transform values but when I use <h5> the text appears to be bold. Is it possible to fix that? Look at this page: https://www.mattbairdsound.com/misc-tv Password: sound You can see the problem 7 rows down on the image 'Neither Fish Nor Fowl: The Story Of An Anglo Irish Family'.
tuanphan Posted July 3, 2023 Posted July 3, 2023 Add to Design > Custom CSS .gallery-caption-wrapper h5 { font-weight: normal !important; } 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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment