Jump to content

Make an image a link

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://www.emeraldtechrepair.com/macbook

Password: test

So apparently my template doesn't natively support adding a URL to an image. 

Was looking for a simple way to accomplish adding an <a href="#"> but it's a lot more difficult than I thought. Any tips? I'm new to squarespace and trying to find a straightforward solution. 

Looking to add a link to either of the 3 MacBook images and unsure how to directly edit HTML, as well as target each specific element because none of them have a class name. I've read some #ID's can change on each page load, so I'm not sure how to handle this. 

The html/css structure is already stressing me out.

Edited by emtech
Added temp password
Link to comment
  • Replies 8
  • Views 616
  • Created
  • Last Reply

Top Posters In This Topic

On 12/17/2021 at 6:43 AM, emtech said:

@tuanphanYeah if you could point me in the right direction that'd be awesome. 

Can you add a text link in List Item Description? Then we will paste it link to image link & hide text link

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
On 12/20/2021 at 4:14 AM, emtech said:

@tuanphan I assume you mean like this? I've added a link to the MacBook's description on the landing page. That links to the /macbook page. 

 

Thanks for your help btw!

image.thumb.png.2e16c0e5adc0b18f514e6d7be284e1c3.png

 

Yes. Same it. Can you keep text link? Now I don't see link here. Or if you use a Business Plan or higher, we can use script code to add click event on these images.

What do you think?

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

@tuanphanYup I'm on ecommerce so I can use code injection. Think this needs a js eventlistener? 

Edit: Just realized, my last test link was added to the homepage. I've updated it to work for the /macbook link I originally said on the post. Hopefully this is helpful. 

 

image.thumb.png.4acc3d335d89629e299034f130852fff.png

Edited by emtech
Link to comment
  • Solution

Add to Macbook Page Header

<style>
  li.list-item {
    position: relative;
}
.list-item-content__description {
    position: static;
}
.list-item-content__description a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

</style>

 

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.