设为首页 收藏本站
查看: 826|回复: 0

[经验分享] outlook 2007 背景 z-index

[复制链接]

尚未签到

发表于 2015-9-13 08:33:54 | 显示全部楼层 |阅读模式
  http://www.campaignmonitor.com/forums/viewtopic.php?id=3862
  


Background images for Outlook 2007 and Outlook 2010 beta
.Net programming                                  | Posted: April 23rd, 2010 | dolbikaa  According to statistics about 45% of people use Microsoft Outlook as email client. About 10% of people use Outlook 2007. So it is a big deal for marketing departments to create and implement attractive HTML emails using Outlook 2007 email client. And it was pretty easy to do using any version of Microsoft email client released earlier Outlook 2007.
  Why?
  The problem is that both Outlook 2007 and 2010 beta do not support background images for any element except body. So which difference between these two versions leads to this issue? Outlook 2003 uses Internet Explorer to render HTML emails. Unfortunately Outlook 2007 uses Microsoft Office for this purpose.
  So Outlook 2007 does not support background images same as older Outlook versions do. But everybody who works with Microsoft word faces the situation when he/she needs to insert an image behind the text.  Outlook also has the same possibility, but with some restrictions.
  At first we should say that Microsoft word uses VML (Vector Markup Language) to produce vector graphics. This language allows including different figures, shapes and images in Microsoft Word. The most important thing for us is that VML supports image absolute positioning and z-indexes.
  Here is the simplest code to insert a background image into an HTML email for MS Outlook:


<!–[if gte vml 1]>
<v:shape
stroked=’f’
style= ‘position:absolute;
z-index:-1;
visibility:visible;
width:583px; height:220px;
top:0;
left:10px;border:0;’>
<v:imagedata src=”http://domain.com/image.png”/>
</v:shape>
<![endif]–>  In order to insert a “background” image into Outlook email you should at least add a “shape” element and an inner “imagedata” element.
Shape – this is a top level element used to describe a shape. It has a lot of attributes but we need only 2 of them:

  • Stroked (t/f) – defines if image has border
  • Style – defines the style of the shape (width, height, position and etc)
  For more information visit next link Vector Markup Language (VML).
Imagedata – this is an element which defines an image for the Shape.
  So in order to make an image behave like background image for Microsoft Outlook, just perform the following steps:
  1. Add the following namespace into your email HTML tag in order to support VML tags:


xmlns:v=”urn:schemas-microsoft-com:vml”  2. Add the following style block as per some Microsoft documentation :


<style type=”text/css”>
v\:* { behavior: url(#default#VML); display:inline-block}
</style>  3. Create a container for the image (table or div). If you want other email clients (yahoo, aol or other)to support this email , set background image according to HTML standard.
  4. Place <!–[if gte vml 1]> <![endif]–> comment block within the container. This code guarantees that only Microsoft Outlook will render the image. You should use this comment to avoid duplicated images rendering in Internet Explorer as it also supports VML.
  5. Add shape and imagedata elements within the comment block and configure the image according to your needs (width, height). Set image position to absolute, set image left and right shift. And also don’t forget to set z-index to -1.
  This value guarantees that the text will be on the image.
  Your email will look in the following way:
DSC0000.jpg
  Download full source code of the email.
  Solution restrictions
  This solution is good because it is a single one! But of course it has some restrictions:
1.  Some bulk mailing services remove comments code during email sending.
2. You shouldn’t use background color. If you use the background color, it will overlap the background image and you will get the following result:
DSC0001.jpg
  3. You will not see background images in Outlook 2007 if you perform the following steps:
  a. Create an HTML email which supports both web and Outlook email clients.
b. Send this email to a web email client.
c. Open your email and forward it to a person who uses Outlook 2007.
  As a result there are no background images.
  4. A user will see background images as simple inline images if you forward your email from Outlook client to Web client.
5. You have to use the whole image for background in any case. This means that if you have a simple gradient, you cannot cut a one pixel stripe and repeat it. You have to cut the whole image.
  Good luck and never have problems with Outlook emails in future!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-112852-1-1.html 上篇帖子: 卸载Outlook Express 下篇帖子: Outlook错误代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表