【发布时间】:2014-03-02 00:04:50
【问题描述】:
我想在电子邮件通讯中实现响应式图像,例如手机。为此,我使用了来自 templates.mailchimp.com 的代码 sn-p 并将其插入到我要更改的图像上方的正文中:
<style type="text/css">
@media only screen and (max-width: 480px){
.emailImage {
height:auto !important;
max-width:600px !important;
width: 100% !important;
}
}
</style>
对于我想要响应的图片,我添加了 class=”emailImage”。 可悲的是,现在这行不通。任何人都可以解释为什么或为我的问题提供更好的解决方案? 如有必要,这里是我的时事通讯中的完整代码:http://pastebin.de/39651?
谢谢
【问题讨论】:
-
如果我们幸运的话,这种功能将在 2028 年初得到电子邮件客户端的支持。见CSS classes in email
-
另请参阅campaignmonitor.com/css,了解哪些客户端支持哪些功能
标签: html css responsive-design