Html 在AMP页面中添加map iframe时显示错误
在amp页面中显示错误 但我已经添加了标签,直到600像素的高度,它工作正常Html 在AMP页面中添加map iframe时显示错误,html,iframe,amp-html,Html,Iframe,Amp Html,在amp页面中显示错误 但我已经添加了标签,直到600像素的高度,它工作正常 error.js:195 <amp-iframe> elements must be positioned outside the first 75% of the viewport or 600px from the top (whichever is smaller): <amp-iframe width="600" height="400" title="Google map pin o
error.js:195 <amp-iframe> elements must be positioned outside the first 75% of the viewport or 600px from the top (whichever is smaller): <amp-iframe width="600" height="400" title="Google map pin on Googleplex, Mountain View CA" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups" frameborder="0" src="https://www.google.com/maps/embed/v1/place?q=place_id:ChIJ2eUgeAK6j4ARbn5u_wAGqWA&key=AIzaSyC544Fo4Prg6ZUNNfmi8cC5Rhs4ZckTGSw" class="i-amphtml-element i-amphtml-layout-responsive i-amphtml-layout-size-defined i-amphtml-error i-amphtml-layout" i-amphtml-layout="responsive">…</amp-iframe> Current position 195 . Min: 480 Positioning rules don't apply for iframes that use `placeholder`.See https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/amp-iframe.md#iframe-with-placeholder for details.
error.js:195个元素必须位于视口的前75%之外或距离顶部600px(以较小者为准):… 当前位置195。Min:480定位规则不适用于使用“占位符”的iFrame。请参阅https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/amp-iframe.md#iframe-带有占位符以获取详细信息。
根据AMP文件,
amp iframe有几个重要的细节,旨在使其更安全,并避免amp文件被单个iframe控制:
- amp iframe可能不会出现在文档顶部附近(使用占位符的iframe除外,如下所述)。当滚动到顶部时,iframe必须距离顶部600 px,或者不在视口的前75%范围内,以较小者为准
- 默认情况下,amp iframe是沙盒(请参见详细信息)。 amp iframe只能通过HTTPS、数据URI或srcdoc属性请求资源
- amp iframe不能与容器位于同一原点,除非它们不允许在“沙盒”属性中使用同一原点。有关Iframe允许的来源的更多详细信息,请参阅“Iframe来源政策”文档。 更多细节可以找到