Jump to content

How to add a hyperlink to the gallery caption overlay/hover effect (whole image)?

Recommended Posts

Hi, I have used the following css to give my gallery a hover effect.

.gallery-caption {
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0,0.4); /* overlay color */
height: 100%;
max-width: unset;
padding: 0;
opacity: 0;
}
.gallery-caption-wrapper {
display: flex;
align-items: center; /* center vertically */
justify-content: center; /* center horizontally */
}
.gallery-caption-content {
font-size: 20px !important; /* caption font size */
color: white; /*caption font color */
}
.gallery-strips-item {
position: relative;
}
.gallery-strips-item:hover .gallery-caption {
opacity: 1;
}
.gallery-caption-strips-simple {
transition-delay: 0ms;
}

.gallery-caption a {
color: white; /* color of the caption text */
}

 

I have changed the text captions so they are clickable as links. However, only the text itself is clickable, not the whole image. You have to specifically hove over the text to click the link. Is there a possibility to change the code so the whole image is clickable and opens the link?

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi. Try adding pointer-events

.gallery-caption {
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0,0.4); /* overlay color */
height: 100%;
max-width: unset;
padding: 0;
opacity: 0;
pointer-events: none; /* enable clickable */
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.