Forum Moderators: open

Message Too Old, No Replies

URL link for amp-img

         

snowfrost88

6:38 am on May 11, 2017 (gmt 0)

5+ Year Member



Hi ,
Can amp-img accept a url link as I need to display the image? I tried using the below codes and was not able to display the image.

<amp-img alt="" src="https://example.com/example/example.jpg"></amp-img>

[edited by: engine at 7:34 am (utc) on May 11, 2017]
[edit reason] examplified [/edit]

NickMNS

11:36 am on May 11, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The nice thing about amp is that you can easily test it to see if works.

Add it to your page, then open the page in chrome and add #development=1 after the url in the address bar. This validates the amp code in the console (inspect element). If it works a message will appear in the console:
AMP validation successful.

if it doesn't validate it will give you errors and point you to the problem.

james007

10:45 am on Aug 27, 2017 (gmt 0)

10+ Year Member Top Contributors Of The Month



Where snowfrost was going wrong here, incidentally, was that amp-img requires a width and height.