Outlook 2007/10/13< style media =" print">解决 [英] Outlook 2007/10/13 <style media="print"> work around
问题描述
在测试电子邮件营销活动时遇到了困扰我的事情.
这就是:
我使用以下代码,以便在用户打印电子邮件时不会打印图像和其他一些信息(这是针对酒店团体的,因此经常打印电子邮件,其中包含预订号和所有信息).
<style media="print">
body { background-color:#FFFFFF; }
.no-print { display:none; }
</style>
现在,展望2007年10月13日,美国在线邮件和其他一些客户似乎将自己视为印刷媒体,并在每个无印刷元素上应用display:none规则,使电子邮件处于空虚的可怕状态. /p>
我可以完全删除所有内容,但这对生态学来说不是好习惯.
你们中有人知道解决方法吗? 像强迫Outlook将自己视为屏幕媒体的方法吗?
非常感谢.
现在,我对这个问题有了更好的理解,我认为为您找到了可能的解决方案的开始.这样可以确保打印机样式表CSS仍然可以正常工作,但是不应由客户端(如Outlook 2007)显示,而不应该显示这些样式表.
- 对电子邮件进行原样"测试,并确保足够的Outlook 2007为空白,因为它应用了打印样式表
- 然后我在下面的代码示例中添加了此媒体查询
- Outlook 2007与其他客户端一起显示,因此它忽略了打印样式表
- 现在在Google Chrome浏览器的打印预览中,不显示带有
.no-print
的文本
代码摘录:
<style media="print">
@media only print {
body { background-color:#FFFFFF; }
.no-print { display:none; }
}
</style>
</head>
<body >
<h1 class="no-print" style="font-size: 36px">LINE OF TEXT</h1>
电子邮件测试链接: https://litmus.com/pub/49bfd3b
I've encountered something that bugged me while testing my email marketing campaigns.
So here goes:
I use the following code so that images and some other bits won't print when a user prints the e-mail (It is for a hotel group so emails are printed often, with booking numbers and all).
<style media="print">
body { background-color:#FFFFFF; }
.no-print { display:none; }
</style>
Now, outlook 2007/10/13, aol mail and some other clients seem to consider themselves as printed media and apply the display:none rule on every no-print element, leaving the email in a dire state of emptiness.
I could remove it all completely, but that wouldn't be good practices for ecology.
Do any of you guys know of a work around? Like a way to force outlook to consider itself as a screen media?
Thanks a lot.
Now that I have a better understanding of the question I think I found the beginning of a possible solution for you. This should ensure the printer style sheets CSS still work, but aren't displayed by clients, like Outlook 2007, when they shouldn't be.
- Ran test with email 'as is' and sure enough Outlook 2007 was blank because it applied the print style sheets
- Then I added this media query in the code example below
- Outlook 2007 shows up with the other clients so it's ignoring the print stylesheet
- Now in Google Chrome's print preview the text with
.no-print
doesn't display
Code Excerpt:
<style media="print">
@media only print {
body { background-color:#FFFFFF; }
.no-print { display:none; }
}
</style>
</head>
<body >
<h1 class="no-print" style="font-size: 36px">LINE OF TEXT</h1>
Email Testing Link: https://litmus.com/pub/49bfd3b
这篇关于Outlook 2007/10/13< style media =" print">解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!