如何设置AMP图像居中对齐 [英] How to set AMP image Align Center

查看:142
本文介绍了如何设置AMP图像居中对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何按照以下步骤在功放页面中进行设置?

How to set in amp page like follow?

<p align="center"><img src="img/LOCK1.png" width="40"> <img src="img/lock2.png"  width="40"> <img src="img/LOCK3.png" width="40"></p>

谢谢!

推荐答案

对于amp,您需要使用amp-img标签

For amp you need to use amp-img tag

AMP HTML文件不支持普通的HTML img标签.借助amp-img,AMP可以提供强大的替代品.

AMP HTML files don't support the normal HTML img tag. With amp-img AMP provides a powerful replacement.

<p>
    <amp-img src="img/LOCK1.png"  layout="fixed" width="40" height="40" alt="Lock1"></amp-img>
    <amp-img src="img/lock2.png"  layout="fixed"  width="40" height="40" alt="Lock2"></amp-img>
    <amp-img src="img/LOCK3.png"  layout="fixed" width="40" height="40" alt="Lock3"></amp-img>
</p>

请参考: amp-img

您不能在放大器中使用内联和外部CSS

You can not use inline and external css in amp

您可以使用具有以下语法的内部CSS

You could use internal css with following syntax

<style amp-custom>
  p {
    text-align: center;
  }
</style>

这篇关于如何设置AMP图像居中对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆