Jump to content

Link in Text file (image) reveal on hover, instead of opening as a page.

Recommended Posts

  • Replies 1
  • Views 191
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hey @bjaakkola,

there is used a code block to get this done. This code needs to be added in code block for each link:
 

<a href="#" class="link-with-image">Hover over me</a>
<div class="image-container">
  <img src="path/to/image.jpg" alt="Image description">
</div>

And this is the CSS code that needs to be added only once:

.image-container {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
}

.link-with-image:hover + .image-container {
  display: block;
}

So basically the image will be hidden by default and will display only when you hover over the link.

Hope this helps.
 

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.