two columns with background-image in outlook - outlook

I want to create two tables that are next to each other in outlook, and they should be placed in a table with an background image.
I know that one can create a background image in an outlook email like this:
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;">
<v:fill type="frame" src="image.jpg" color="#F4C046" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td align="center">
<!-- place content here -->
</td>
</tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
I also know that one can create a two column table design like this:
<table width="600" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<table class="full-width" width="295" align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="left" style="font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: 400; color: #000; line-height: 24px;">
hi
</td>
</tr>
</table>
<table class="full-width" width="295" align="right" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="center">
<img class="img-full" src="image_1.jpg" alt="img" width="295" height="250">
</td>
</tr>
</table>
</table>
However, when I put the above table into <!-- place content here --> then the background is working, but the two tables are not next to each other, but below each other.
Is it possible to get both working in outlook?
I don't want to create a single table with two columns, because it should be responsive in addition. When I have two tables I can simply set the width of the tables to 100% with media queries.
I also tried using floats on the two tables as explained in How do I get my two tables to align beside each other?, but this is also ignored in Outlook.

You have two options:
Use ghost tables. The reason your tables are stacking in Outlook is because you aren't adhering to the Outlook rule of 20px gap between tables. Stupid rule, but it's a known issue.
Reduce the width of your tables to adhere the to 20px gap Outlook rule. So make both inner tables, 290px. This way, you'll avoid needing Ghost tables. But that impacts the width available to the content inside of those tables.
Honestly, Ghost tables are your best option. I use them religiously, in almost every build. These will only render in Outlook, so you won't have issues with responsiveness on mobile.

I have taken your code and made changes to it.
A new table added to encase your two columns.
Ghost column added for Outlook support
New table added to encase the VML and two column block
Added width and height to your VML
#media only screen and (max-width : 480px) {
.full-width{width:100% !important}
}
<table width="600" border="0" cellspacing="0" cellpadding="0" class="full-width">
<tbody>
<tr>
<td><!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;width:600px;height:250px;">
<v:fill type="frame" src="image.jpg" color="#F4C046" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<table width="600" border="0" cellpadding="0" cellspacing="0" class="full-width">
<tr>
<td><table class="full-width" width="300" align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="left" style="font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: 400; color: #000; line-height: 24px;"> hi </td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]> </td><td align="left" valign="top" width="300"> <![endif]-->
<table class="full-width" width="300" align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="center"><img class="img-full" src="image_1.jpg" alt="img" width="295" height="250"></td>
</tr>
</table>
</tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]--></td>
</tr>
</tbody>
</table>
I havent tested your VML as it has a relative path
Once you have tested the above code, let me know if this works for you.

What Outlook is actually doing, if you look close, is creating a "text box" and anything that goes in there is made into an image. So while this method gives you the illusion of a background image in outlook, it's really just that, an illusion. You'd be better off making an image and using that. This is probably why your tables are getting all messed. I discourage you from using this method for anything other than very simple background images.

Related

Outlook 2019 doesn't pick up classes value if I apply conditional format, all other email clients including Outlook 365 works

if I apply conditon class style won't render
<!--[if mso]>
<table border="0" cellspacing="0" cellpadding="0" class="cta-test">
<tr>
<td align="center">
test
</td>
</tr>
</table>
<![endif]-->```
Literally just ran a test with this code and it worked fine.
Three tests.
To replicate your issue
Mimicking your issue but without the conditional code surrounding it, to see if there is any difference
Another inline test for comparative testing.
All rendered as expected.
.cta-test { border:1px solid red; }
<!--[if mso]>
<table border="0" cellspacing="0" cellpadding="0" class="cta-test" style="width:200px;">
<tr>
<td align="center">
test
</td>
</tr>
</table>
<![endif]-->
<table border="0" cellspacing="0" cellpadding="0" class="cta-test" style="width:200px;">
<tr>
<td align="center">
test 2
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid blue; width:200px;">
<tr>
<td align="center">
test 3
</td>
</tr>
</table>
The issue could be the specific CSS property you're trying to apply as tables aren't always the best option for applying styles.
What is it you're trying to do with that CTA in Outlook?

Add image at background, outlook problems

have problem like in title. Have email template, everything are ok, but background image doesn't work on outlook. Unfortunately most people in my country use it. Below my code:
<!--#subject Email - Header #-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</head>
<body>
{{var non_inline_styles}}
<!-- Start Image Background -->
<table class="image-background" cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="22262b" background="http://met.ivycommerce.eu/glamoura_main_image.jpg">
<tr>
<td class="image-background" align="center" style="background: url('http://met.ivycommerce.eu/pattern.png') 0 0 repeat">
<table class="container-table" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="separator-50" height="50"> </td>
</tr>
<!-- Start Three Column -->
<tr>
<td>
<table class="container-table" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="center" align="center">
<a href="{{store url=""}}">
<img style="display: block; margin: 0 auto;"
{{if logo_width}}
width="{{var logo_width}}"
{{else}}
width="165"
{{/if}}
{{if logo_height}}
height="{{var logo_height}}"
{{else}}
height=""
{{/if}}
src="{{var logo_url}}"
alt="{{var logo_alt}}"
border="0"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
<!-- Start Three Column -->
<tr>
<td class="separator-30" height="30"> </td>
</tr>
<tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="60">
<tr>
<td class="separator-line" bgcolor="#ffffff" height="1"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="separator-30" height="30"> </td>
</tr>
<tr>
<td class="colored-heading" align="center" height="28">
<div style="line-height: 28px;">Nasza Misja</div>
</td>
</tr>
<tr>
<td class="heading" align="center" height="28">
<div style="line-height: 28px;">To uśmiechnięci Klienci</div>
</td>
</tr>
<tr>
<td class="separator-10" height="10"> </td>
</tr>
<tr>
<td class="sub-heading" align="center" height="24">
<div style="line-height: 24px;">Dziękujemy, że dołączyłeś do wielkiego grona Bionaturalnych.</div>
</td>
</tr>
<tr>
<td class="separator-50" height="50"> </td>
</tr>
<tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="button" align="center" valign="middle" height="38" width="140">
Wejdź Do Sklepu
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="separator-50" height="50"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- End Image Background -->
<!-- Begin wrapper table -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="background-table">
<tr>
<td valign="top" class="container-td" align="center">
<table cellpadding="0" cellspacing="0" border="0" align="center" class="container-table">
<tr>
<td valign="top" class="top-content">
<!-- Begin Content -->
I was try with some code, but not success :( when background are ok, rest align left, but have to be center. Can somebody help me?
Outlook generally requires old school type programming and has a lot of things that are not permitted in email that are allowed in website programming. This means that the style works best when included in the header and background images cannot be used. If you want to use a background image, say behind a title for example, you would need to create the title and background as a single image to insert as you would any other image. The downside to this is that Outlook will not download images unless the user specifies to do so. Since a majority of your users use Outlook, best practices says to program for them and then test it across all other browsers. Here is a list of issues identified by Mailchimp, an email service provider, that specifically pertain to Outlook and what fixes, if available, can be performed. http://kb.mailchimp.com/campaigns/previews-and-tests/my-campaign-looks-bad-in-outlook.
In reviewing your code provided, here are some other things that I think you might want to consider:
Use fixed measurements instead of percentages;
Instead of using code for spacing, use a 1px x 1px transparent or background colored image that you can adjust the height and the width of to make the space work the way you want;
Put all styles at the top in css format, for example:
<style type="text/css">
body{
margin:0;
padding:0;
font-family:"Trebuchet MS", arial, sans-serif;
}
</style></head>
I have been programming email newsletters for almost ten years now and the most simple, basic code works the best when the majority of your users have Outlook. Finally, I recommend that you always run your code through an html validator, such as https://validator.w3.org/ to check your code. Even the smallest error can result in unanticipated results with Outlook or other browsers.
Zydol,
To make this work, you will need to use VML to create an object and assign the background image to that. You can read more about this technique here: https://www.emailonacid.com/blog/article/email-development/emailology_vector_markup_language_and_backgrounds
I do believe Bulletproof Backgrounds is the answer you're looking for!
https://backgrounds.cm/

html email padding-right issue on Mail client Mac

I've got a problem getting my html email to render properly on Mac Mail client. Basically a white strip ~20px wide appears on the right hand side of the display.
This is a html I'm using:
<div style="padding:30px !important; height: 60px; border-bottom: 10px solid #07d7ed;">
<div style="width:100%">
<div style="float:left">Logo</div>
<div style="float:right">Some Text</div>
</div>
</div>
Any ideas, why this happened?
divs are not supported everywhere and often come with their own styling. Try using a table instead:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" valign="top">
<table width="48%" cellspacing="0" cellpadding="0" border="0" align="left">
<!--Use less than 50% width to account for outlook which adds space to floated tables -->
<tr>
<td align="left" valign="top">Logo</td>
</tr>
</table>
<table width="48%" cellspacing="0" cellpadding="0" border="0" align="right">
<!--Use align instead of float to account for older browsers and outlook which don't handle floats correctly-->
<tr>
<td align="left" valign="top">sometext</td>
</tr>
</table>
</td>
</tr>
</table>
Try this and see if it fixes your problem. If not, see if you can post a screenshot.

MailChimp content blocks drag&drop not working

I had to edit existing custom template in MailChimp service where drag&drop of content blocks isn't working. Template had a lot of nested tables so I contacted their support with response that some of block are nested and it might cause conflicts. To make simple test case scenario I removed most of code, styles and left just one repeatable block with one editable header inside.
I was doing everything as mentioned in this part of documentation.
According to article, on edit screen after clicking on this double arrow some kind of yellow bar should popup but there was nothing happening. I tried to click and drag it.
Question here is how make replicable and draggable content block on MailChimp.
My code below.
<body leftmargin="0" marginwidth="0" topmargin="0" style="color: #fff;" marginheight="0" offset="0">
<center>
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
<tr>
<td align="center" valign="top" id="bodyCell">
<!-- BEGIN TEMPLATE // -->
<table border="0" cellpadding="0" cellspacing="0" id="templateContainer">
<tr>
<td align="center" valign="top" style="padding-right:33px; padding-left:33px; text-align: left;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateLectures">
<tr>
<td valign="top" style="padding-top:10px; padding-bottom:10px; font-size: 12px;">
<h3 class="imagereplacement" style="text-indent: 100%; white-space: nowrap; overflow: hidden;padding-bottom:10px;"><img src="http://gallery.mailchimp.com/42cd17e5e3c7c6f9274766dc5/images/lectures.png"><span style="display: block !important;">Lectures</span></h3>
<div mc:repeatable="lecture" mc:variant="lecture" class="single_event">
<h5 mc:edit="lecture_event_title">Koloman Moser In Context</h5>
<h6>Thursday, May 23</h6>
<p class="eventtitle">Christian Witt-Dörring</p>
<p class="eventtext">Curator, Koloman Moser, Designing Modern Vienna 1897–1907</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // END TEMPLATE -->
</td>
</tr>
</table>
</center>
</body>
Save your template. After go in campings, create new camping, click next, after this choose your template, and after this you can drag your blocks and save changes if you want.

Mobile email images are not downloading on mobile device - multiple platforms

I'm building a mobile friendly email and the main images do not load when the email initially loads (the small facebook and twitter icons in the footer do load). I say, loading rather than displaying bc there aren't any red x's on the screen or any indication there there should be images there. However, if I go back to the inbox and click on the email to view it again, the images load just fine. I tested this on the iPhone and Android in the web email clients, yahoo and gmail, and it's happening in all those instances. I've received mobile emails in the past where the images load just fine, so it's got to be my code. I've been having a heard time finding the answer to this, so I hope someone here is familiar with this issue and can help me out. Let me know if you have questions. I appreciate the help, very much.
Note: I discovered it's also not displaying the images in Safari but only on first load. When the page is reloaded - just like in the mobile browsers, it loads the images.
Here's a link from Campaign Monitor:
http://testclient.createsend4.com/t/ViewEmail/y/8B8E5FE792737812
Here's the code:
<html>
<head>
<!-- If you delete this tag, the sky will fall on your head -->
<meta name="viewport" content="width=device-width" />
<title></title>
<style type="text/css">
<!--
img {display:block; border:0;}
body {
background-color: #ffffff;
-webkit-font-smoothing:antialiased;
-webkit-text-size-adjust:none;
margin:0;
padding:0;
} -->
</style>
</head>
<body bgcolor="#ffffff" style="width:100%;height:100%;">
<table cellpadding="0" cellspacing="0" width="100%" align="center" bgcolor="#ffffff" border="0" style="font-family:Arial, Helvetica, sans-serif">
<tr><td>
<!-- HEADER -->
<div class="content" style="max-width:600px;margin:0 auto;display:block;">
<table cellpadding="0" cellspacing="0" height="37" align="center" bgcolor="#ffffff" border="0" style="font-family:Arial, Helvetica, sans-serif">
<tr>
<td valign="bottom" style="text-align:center; color:#5b5a5a; font-size:11px;">
Email not displaying correctly? <webversion style="color:#5b5a5a; text-decoration:underline;">View it in your browser</webversion>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" height="34" align="center" bgcolor="#ffffff" border="0" style="font-family:Arial, Helvetica, sans-serif">
<tr>
<td style="color:#939497; text-align:center;"><strong>Shop Online</strong> | <strong>Find A Store</strong> | <strong>Forward To A Friend</strong>
</td>
</tr>
</table>
</div>
<table cellpadding="0" cellspacing="0" width="100%" align="center" bgcolor="#000000" border="0" style="font-family:Arial, Helvetica, sans-serif">
<tr><td>
<div class="content" style="max-width:600px;margin:0 auto;display:block;">
<table cellpadding="0" cellspacing="0" align="center" bgcolor="#000000" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_06.png" width="100%" style="display:block;border:0;color:#ffffff;" alt="Beyond RTO Home Furnishings & Appliances For Less." border="0" /></td>
</tr>
</table>
</div>
</td></tr>
</table>
<!-- PROMO -->
<div class="content" style="max-width:600px;margin:0 auto;display:block;">
<table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_07.jpg" border="0" width="100%" style="display:block;" alt="Celebrate Christmas in July - Register to Win $1000 Shopping Spree!"/></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_08.jpg" border="0" width="100%" style="display:block;" alt="Plus enjoy this bonus offer and SAVE!"/></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_09.jpg" width="100%" border="0" style="display:block;" alt="Reveal Your Deal with Beyond RTO!"/></td>
</tr>
</table>
</div>
<!-- FOOTER -->
<table cellpadding="0" cellspacing="0" width="100%" align="center" bgcolor="#000000" border="0" style="font-family:Arial, Helvetica, sans-serif">
<tr><td>
<div class="content" style="max-width:600px;margin:0 auto;display:block;">
<table cellpadding="0" cellspacing="0" align="center" bgcolor="#000000" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_10.png" width="100%" border="0" style="display:block;" alt="Beyond RTO Home Furnishings & Appliances For Less."/></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" height="21" align="center" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td align="center" valign="top" style="font-size:13px;color:#939497;"><strong>Shop Online</strong> | <strong>Find A Store</strong> | <strong>Forward To A Friend</strong></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td><img src="images/2959_BYRTO_July_emailer_13.png" width="40" height="44" border="0" style="display:block;"/></td>
<td><img src="images/2959_BYRTO_July_emailer_14.png" width="36" height="44" border="0" style="display:block;"/></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" height="50" align="center" style="font-family:Arial, Helvetica, sans-serif" border="0">
<tr>
<td align="center" valign="top" style="font-size:10px;color:#bebebe;line-height:14px;">
© Copyright 2013 Baber's. All Rights Reserved.<br/>
You are currently subscribed as [email]. Click here to <unsubscribe style="color:#82c13a;text-decoration:underline;">unsubscribe</unsubscribe>.</td>
</tr>
</table>
</div>
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
I finally figured this out. Once I discovered this was also happening in Safari, it was easier to trouble shoot. I figured out that some of the tables did not have a width defined and Safari requires a width value and so do mobile email clients apparently. I normally have widths on all my tables, so didn't realize that was the culprit this time.

Resources