Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

How do I add a hover effect for captions on my home page gallery?


Recommended Posts

Site URL: https://thepiewitch.com/

Hello, 

I have the template Tresoire, which has a large grid: masonry format on the home page. I chose the template for this photo/gallery design because I liked the simplicity. The template only allows the captions of the images to be below the image, which on mobile looks horrible. Plus, I only plan to add caption to some of the photos, so the inconsistency of the text below looks weird.

I would like to add a hover effect to the photos so that when people see the photo they know what the product is. Is there a way to be able to do it with this template?

Link to comment
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
12 hours ago, anwyatt said:

Yes I added image caption to the page so you can see! Thank you for looking into this for me! 

Add to Home > Design > Custom CSS

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