Jump to content

Hover title on image block

Go to solution Solved by Web_Solutions,

Recommended Posts

Hi guys,

I am new to create website and i have issues with the css. 

In my "work" page, I create 16 images blocks for my showcases and I add titles on each blocks.

I want the title gone when hover so I follow some youtubers code. The code works when i am in editing mode. However, It not working on preview so I wonder what happen or is there anyway i can improve it.

the code i am using for each block

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

#block-yui_3_17_2_1_1697078785160_29302:hover {
opacity: 1;
transition: opacity 0.5s
  }}

It is my website :  dinosaur-gopher-x6fh.squarespace.com

password:makingmovies

Thanks for the help.

Edited by yuinia
Link to comment
  • Solution
3 hours ago, yuinia said:

Hi guys,

I am new to create website and i have issues with the css. 

In my "work" page, I create 16 images blocks for my showcases and I add titles on each blocks.

I want the title gone when hover so I follow some youtubers code. The code works when i am in editing mode. However, It not working on preview so I wonder what happen or is there anyway i can improve it.

the code i am using for each block

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

#block-yui_3_17_2_1_1697078785160_29302:hover {
opacity: 1;
transition: opacity 0.5s
  }}

It is my website :  dinosaur-gopher-x6fh.squarespace.com

password:makingmovies

Thanks for the help.

 

Add these code on Custom CSS panel in Website Utilities Website Tools > Custom CSS.

@media only screen and (min-width: 768px){
  .fe-65275e92573640628018fb6d .html-block {
    opacity: 0 !important;
    transition: opacity 0.3s;
  }
  .fe-65275e92573640628018fb6d .html-block:hover {
    opacity: 1 !important;
  }
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

Thank for the solution, it works.

May i wonder what your code means? just for learning

Also i have the same structure in another page, how should i change the code you provide to make it work on another page? 

Edited by yuinia
Link to comment
On 10/18/2023 at 9:02 AM, yuinia said:

Thank for the solution, it works.

May i wonder what your code means? just for learning

Also i have the same structure in another page, how should i change the code you provide to make it work on another page? 

#1. min-width: 768px means the code will run on screen size > 768px (usually = tablet + desktop only)

image.thumb.png.2ea60d0e21a62a651bbaa6abaf4475d8.png

#2. It is ID...you will need to know a bit of code to find this, you can share link to another page, we can adjust code for you.

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

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.