Soundcloude iframe: AMP HTML Tag has an invalid layout specified by its attrs.
-
I have several pages that embed an iframe similar to the one below:
<iframe src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/611025615&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true" width="100%" height="166" frameborder="no" scrolling="no"></iframe>
As you can notice, the iframe’s width is 100%
However, AMP Search Console is throwing the following error:
AMP HTML Tag has an invalid layout specified by its attributes.
Invalid value '0' for attribute 'width' in tag 'amp-iframe' - for layout 'FIXED_HEIGHT', set the attribute 'width' to value 'auto'.
The parsed HTML looks like this:
<p><amp-iframe src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/611025615&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true" width="0" height="166" frameborder="0" scrolling="no" sandbox="allow-scripts allow-same-origin" layout="fixed-height"><span placeholder="" class="amp-wp-iframe-placeholder"></span><noscript><iframe src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/611025615&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true" width="100%" height="166" scrolling="no"></iframe></noscript></amp-iframe></p>
Our previous
width=100%
is replaced with awidth="0"
, but the strange thing is that if you go to the page and inspect the code, you’ll still see 100%.Any ideas or help would be highly appreciated. Thank you.
The page I need help with: [log in to see the link]
- The topic ‘Soundcloude iframe: AMP HTML Tag has an invalid layout specified by its attrs.’ is closed to new replies.