Welcome to WebmasterWorld Guest from 54.226.33.117

Forum Moderators: martinibuster

URL link for amp-img

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

New User

joined:May 11, 2017
posts: 1
votes: 0


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]

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

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:1586
votes: 424


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.
10:45 am on Aug 27, 2017 (gmt 0)

Junior Member from AU 

10+ Year Member Top Contributors Of The Month

joined:June 28, 2003
posts: 164
votes: 23


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