Jump to content

Hover over effect on an image with text description

Recommended Posts

Posted

Hi, I am trying to add hover effect on 3 images on my home page. When adding hover effect I would like the image to get a dark overlay and 3 different texts that describes it.

Text would consist of big letters (name) and smaller letters (description). 

I am wondering how can I code it and add it in Custom CSS. 

I have tried all the codes that were posted in the forum today and non of them worked for me. 

Posted
3 hours ago, anna_ryzha_portfolio said:

Hi, I am trying to add hover effect on 3 images on my home page. When adding hover effect I would like the image to get a dark overlay and 3 different texts that describes it.

Text would consist of big letters (name) and smaller letters (description). 

I am wondering how can I code it and add it in Custom CSS. 

I have tried all the codes that were posted in the forum today and non of them worked for me. 

Can you share your URL so I can check it?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Posted
On 5/31/2024 at 2:12 AM, anna_ryzha_portfolio said:

@tuanphan, text over image. 

I wanted an overlay that makes the image darker and the text on that overlay appears when the user hovers over the image. 

Can you move text block over image? We can code easier

image.thumb.png.5235a6bb82cfabf1d0e45beb723ff22a.png

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!)

  • 2 weeks later...
  • 3 months later...
Posted

Hi! I am trying to do something similar with my image gallery - making the description visible and the image darker. I tried the method where you have to write every individual description in the CSS, but isn't there a way to just show the description that's connected to the image without rewriting it in the code?

This is what I have so far - I don't want to have to rewrite the description for each link.


.gallery-grid-item.has-clickthrough {
    background-color: black;
}
figure:hover .gallery-grid-image-link::before {
  opacity: 1;}


.gallery-grid-image-link::before {
  opacity: 0;
  z-index: 999;
  position: absolute;
  bottom: 5%;
  left: 5%;
  color: white;
  transition: opacity 1s;}

figcaption.gallery-caption.gallery-caption-grid-simple {
  display: ;}


figure.gallery-grid-item.has-clickthrough:hover img {
  opacity: .85;}

figure.gallery-grid-item.has-clickthrough img {
  transition: opacity .5s;}

/* THIS NEEDS TO BE DONE FOR EACH LINK */
.gallery-grid-image-link[href="/550w21"]::before {
  content: "550 w 21 | residential";
  font-size: 1.5vw;
  font-family:'HelveticaL'
}

Posted
On 10/1/2024 at 8:24 PM, cateosb said:

Hi! I am trying to do something similar with my image gallery - making the description visible and the image darker. I tried the method where you have to write every individual description in the CSS, but isn't there a way to just show the description that's connected to the image without rewriting it in the code?

This is what I have so far - I don't want to have to rewrite the description for each link.


.gallery-grid-item.has-clickthrough {
    background-color: black;
}
figure:hover .gallery-grid-image-link::before {
  opacity: 1;}


.gallery-grid-image-link::before {
  opacity: 0;
  z-index: 999;
  position: absolute;
  bottom: 5%;
  left: 5%;
  color: white;
  transition: opacity 1s;}

figcaption.gallery-caption.gallery-caption-grid-simple {
  display: ;}


figure.gallery-grid-item.has-clickthrough:hover img {
  opacity: .85;}

figure.gallery-grid-item.has-clickthrough img {
  transition: opacity .5s;}

/* THIS NEEDS TO BE DONE FOR EACH LINK */
.gallery-grid-image-link[href="/550w21"]::before {
  content: "550 w 21 | residential";
  font-size: 1.5vw;
  font-family:'HelveticaL'
}

You need to enable Gallery Caption & Add some title first

image

image

Next, use this CSS code

figure.gallery-grid-item {
    position: relative;
}
.gallery-caption {
    position: static;
}
/* title */
figcaption.gallery-caption .gallery-caption-wrapper p.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-grid-item:hover .gallery-caption-wrapper p.gallery-caption-content {
    opacity: 1 !important;
}
/* overlay */
.gallery-grid-item-wrapper a:after {
    background:rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-grid-item:hover .gallery-grid-item-wrapper a:after {
    opacity: 0.75;
}
/* remove gap */
figcaption {
    padding: 0 !important;
}

If it doesn't work, you can share link to your site, we can check 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!)

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.