移动 MJML 上的内嵌图像
我正在尝试使用 MJML 创建电子邮件模板。我想在桌面和移动设备上创建内联图像。我写了这段代码:
<mj-section background-color="#bce0a6">
<mj-column>
</mj-column>
<mj-column>
</mj-column>
<mj-column>
<mj-image src="https://xxxx.png" alt="Twitter icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
<mj-image src="https://yyyy.png" alt="Instagram icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
<mj-image src="https://zzzz.png" alt="Pinteres icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
</mj-column>
<mj-column>
</mj-column>
</mj-section>
我想在移动版本上使图标图像内联,而不使用 MJML 拥有的 mj-social-element
因为我想使用我有的图标图像,但没有图标表示 mj-social-element
提供的服务。
我有办法做到吗?谢谢!
注意:在代码中,我在顶部和底部使用了 2 个空
,以便图标居中,但如果有另一种更简洁的方法,请告诉我!
I am trying to create an email template using MJML. And I want to create an inline of images both on desktop and mobile. I wrote this code:
<mj-section background-color="#bce0a6">
<mj-column>
</mj-column>
<mj-column>
</mj-column>
<mj-column>
<mj-image src="https://xxxx.png" alt="Twitter icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
<mj-image src="https://yyyy.png" alt="Instagram icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
<mj-image src="https://zzzz.png" alt="Pinteres icon" width="24px" padding-top="5px" padding-bottom="5px"></mj-image>
</mj-column>
<mj-column>
</mj-column>
<mj-column>
</mj-column>
</mj-section>
This is the result in desktop version:
This is the result in mobile version:
I want to make the icon images inline as well on the mobile version WITHOUT using the mj-social-element
that MJML has since I would like to use the icon images I have and not the icon images the mj-social-element
offers.
Is there a way for me to do it? Thanks!
NOTE: In the code I used so 2 empty <mj-column>
in the top and bottom so that the icons are centered but if there is another cleaner way to do it please let me know!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其包装在
&lt; mj-group&gt;
中做到了:Wrapping it up in a
<mj-group>
did the trick: