Jump to content

CSS for revealing text on hover not working

Recommended Posts

Hey guys - I'm using the below text to try and reveal a text block placed behind an image to appear on hover. The code is working on my personal website, but when I try it on my clients website it only works when you are in edit mode. Anyone got any ideas? Thank you

 

@media only screen and (min-width: 640px){ 
#block-yui_3_17_2_1_1673492412284_3335 { 
opacity: 0; 
transition: opacity 1s 

#block-yui_3_17_2_1_1673492412284_3335:hover { 
opacity: 1; 
transition: opacity 1s 

}
 

Link to comment
  • 2 weeks later...

Yes I did by complete luck! had to put the usual code twice for each box - one with "min-width" and then one with "max width" - any idea why this worked?

//Reveal Text - Embark//
@media only screen and (min-width: 640px){ 
#block-yui_3_17_2_1_1675062158984_28173 { 
opacity: 0 !important; 
transition: opacity 1s !important 

#block-yui_3_17_2_1_1675062158984_28173:hover { 
opacity: 0.8 !important; 
transition: opacity 1s !important 

}

@media only screen and (max-width: 640px){ 
#block-yui_3_17_2_1_1675062158984_28173 { 
opacity: 0 !important; 
transition: opacity 1s !important 

#block-yui_3_17_2_1_1675062158984_28173:hover { 
opacity: 0.8 !important; 
transition: opacity 1s !important 

}

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.