URL link for amp-img

2.2k Views Asked by At

URL link for amp-img

How do I amp a image url instead of a regular image?

I have already tried to do a amp-html the regular way but it did not work.

1

There are 1 best solutions below

0
On

You have to add AMP Carousel like this :

<amp-carousel id="custom-button"  width="400" height="300" layout="responsive" type="slides" autoplay delay="2000">
<a href="https://www.example.com/amp/" target="_blank"> <amp-img src="https://www.example.com/wp-content/uploads/2020/04/amp_img_1.jpg" width="400" height="300" layout="responsive" alt="AMP Carousel"></amp-img></a>
<a href="https://www.example2.com/amp/" target="_blank"> <amp-img src="https://www.example.com/wp-content/uploads/2020/04/amp_img_2.jpg" width="400" height="300" layout="responsive" alt="AMP Carousel"></amp-img></a>
</amp-carousel>

And then You have to add CSS on anchor tag like this: display:grid;