Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amp html 制作高度响应放大器列表_Amp Html - Fatal编程技术网

Amp html 制作高度响应放大器列表

Amp html 制作高度响应放大器列表,amp-html,Amp Html,我正在努力使amp列表的高度响应 <amp-list width="100" height="1980" [height]="660 * page.items.posts.length" layout="responsive" src="/get_posts/" [src]="'/get_posts?page=' + page" binding="no" reset-on-refresh single-item> <template type="amp-mustache"

我正在努力使amp列表的高度响应

<amp-list width="100" height="1980" [height]="660 * page.items.posts.length" layout="responsive" src="/get_posts/" [src]="'/get_posts?page=' + page" binding="no" reset-on-refresh single-item> 
  <template type="amp-mustache">
    {{#posts}}
      <div class="col-xl-4 col-lg-6 col-md-6 col-sm-12 col-xs-12">
      Post
      </div>
    {{/posts}}
  </template>
</amp-list>

{{{职位}
邮递
{{/posts}
正如你看到的,每次我收到新帖子时,高度都会改变。问题是它在桌面上运行良好,但在移动设备上,我只看到前三篇文章,因为高度很小。
在桌面上,我有一个大的宽度,所以我可以一行得到3列,但在移动设备上,我只能一行得到一列,这就是为什么我需要更高的高度,有什么可以解决这个问题吗?

你可以在amp元素上使用媒体属性,请参阅amp页-

示例-

<amp-img
    media="(min-width: 650px)"
    src="wide.jpg"
    width="527"
    height="355"
    layout="responsive">
</amp-img>

<amp-img
    media="(max-width: 640px)"
    src="small.jpg"
    width="527"
    height="355"
    layout="responsive">
</amp-img>


以上2个元素将根据每个元素中写入的媒体属性条件显示。第一个将在显示大小最小宽度:650px]时显示。

您考虑过@媒体的变化吗?您的意思是什么?请参阅,但问题来自放大器列表