Amp html 如何设置放大器图像对齐中心
如何在amp页面中设置如下内容Amp html 如何设置放大器图像对齐中心,amp-html,Amp Html,如何在amp页面中设置如下内容 <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标签 AMP HTML文件不支持普通HTML img标记。与放大器img放大器提供了一
<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标签 AMP HTML文件不支持普通HTML img标记。与放大器img放大器提供了一个强大的替代品
不能在amp中使用内联和外部css
您可以使用具有以下语法的内部css
<style amp-custom>
p {
text-align: center;
}
</style>
p{
文本对齐:居中;
}
借用@Bachcha Singh的答案,我只在图像代码周围添加了一个div,并在图像放大器代码的正下方添加了内联css代码后,如下图所示才成功。这就是我如何将我的图像集中在我的AMP页面上的方法
<div class="img-wrapper">
<amp-img src="https://jomutech.com/dispJomutechIcon.png height="50" width="250" alt="Logo">
</amp-img>
</div>
<style amp-custom>
div.img-wrapper {
text-align: center;
}
</style>
非常感谢。align=“center”如何?请检查我的更新答案,如果您仍然面临任何问题,请告诉我issue@BachchaSingh非常感谢。我也在寻找同样的解决方案。保存我的日期:)请注意,amp img元素有结束标记,而img没有结束标记,在没有布局属性的情况下指定height=“40”width=“40”意味着图像的布局是固定的,即宽高比为1:1的layout=“fixed”,
<div class="img-wrapper">
<amp-img src="https://jomutech.com/dispJomutechIcon.png height="50" width="250" alt="Logo">
</amp-img>
</div>
<style amp-custom>
div.img-wrapper {
text-align: center;
}
</style>