Site logo

[Support request] image with link

Home Forums Support [Support request] image with link

Home Forums Support image with link

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2069851
    Den

    Hello team,

    I am serving different images for mobile and desktop screens. But I don’t know how to add a link to those images. For example, I want to insert my amazon affiliate link but I don’t know how to do it.

    The affiliate link will be same for both images.

    The code I’m using:

    <picture>
       <source 
          media="(min-width: 650px)"
          srcset="images/img1.png">
       <source 
          media="(min-width: 465px)"
          srcset="images/img2.png">
       <img src="images/img-default.png" 
       alt="a cute kitten">
    </picture>

    Can you please help me out with this.

    #2069878
    David
    Staff
    Customer Support

    Hi there,

    you can wrap your picture element in an anchor link eg.

    <a href="your_link_goes_here">
        <picture>
            <source 
               media="(min-width: 650px)"
               srcset="images/img1.png">
            <source 
               media="(min-width: 465px)"
               srcset="images/img2.png">
            <img src="images/img-default.png" 
            alt="a cute kitten">
         </picture>
    </a>
    #2069882
    Den

    Thanks David.

    #2069887
    David
    Staff
    Customer Support

    Could you raise a separate topic for that question.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.