CMS Development

kleblanc
Participant

Image aligning left in outlook

Hi:

I have an email template I created (first with the drag and drop feature then converting it to HTML) and when I send it to my outlook to preview it, the top image section (which includes headers and CTAs) is aligning left while everything else is aligning center. I have tried so many tags and center things in the HTML to fix it but nothing is working.  Below is the HTML of the email Any help would be greatly appreciated.

 

<!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" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>{% if content.html_title and content.html_title != '' %}{{ content.html_title }}{% else %}{{ content.body.subject }}{% endif %}</title>
<meta property="og:title" content="{% if content.html_title and content.html_title != '' %}{{ content.html_title }}{% else %}{{ content.body.subject }}{% endif %}">
<meta name="twitter:title" content="{% if content.html_title and content.html_title != '' %}{{ content.html_title }}{% else %}{{ content.body.subject }}{% endif %}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
{% if content.meta_description %}<meta name="description" content="{{ content.meta_description }}"/>{% endif %}
<style type="text/css" id="hs-inline-css">
/*<![CDATA[*/
/* everything in this node will be inlined */

/* ==== Page Styles ==== */

body, #backgroundTable {
background-color: #ffffff; /* Use body to determine background color */
font-family: {{ primary_font }};
}

#templateTable {
width: {{800}}px;
background-color: {{ body_color }};
-webkit-font-smoothing: antialiased;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
display:block;
font-weight:bold;
line-height:100%;
margin-top:0;
margin-right:0;
margin-bottom:10px;
margin-left:0;
}

h1, .h1 {
font-size:26px;
}

h2, .h2 {
font-size:20px;
}

h3, .h3 {
font-size:15px;
}

h4, .h4 {
font-size:13px;
}

h5, .h5 {
font-size:11px;
}

h6, .h6 {
font-size:10px;
}

/* ==== Header Styles ==== */

#headerTable {
background-color: #ffffff;
color:{{ primary_font_color }};
font-family:{{ primary_font }};
font-size:10px;
line-height:120%;
text-align:right;
border-collapse: separate !important;
padding-right: {{email_body_padding}}px;
}

#headerTable a:link, #headerTable a:visited, /*Y*/ #headerTable a .yshortcuts /*Y*/{
font-weight:normal;
text-decoration:underline;
}

/* ==== Template Wrapper Styles ==== */

#contentCell {
padding: 10px 20px;
background-color: #ffffff;
}

#contentTableOuter {
border-collapse: separate !important;

background-color: #ffffff;
{% if email_main_body_box_shadow_css and email_main_body_box_shadow_css != '' %}
box-shadow: {{ email_main_body_box_shadow_css }};
{% endif %}

padding: {{email_body_padding}}px;
}

#contentTableInner {
width: {{800}}px;
}

/* ==== Body Styles ==== */

.bodyContent {
color:{{ primary_font_color }};
font-family:{{ primary_font }};
font-size: {{primary_font_size }};
line-height:150%;
text-align:left;
}

/* ==== Column Styles ==== */

table.columnContentTable {
border-collapse:separate !important;
border-spacing:0;

background-color: #ffffff;
}

td.columnContent {
color:{{ primary_font_color }};
font-family:{{ primary_font }};
font-size:{{primary_font_size }};
line-height:120%;
padding-top:20px;
padding-right:20px;
padding-bottom:20px;
padding-left:20px;
}

/* ==== Footer Styles ==== */

#footerTable {
background-color: {{ background_color }};
}

#footerTable a {
color: {{ secondary_font_color }};
}

#footerTable {
color:{{ secondary_font_color }};
font-family:{{ primary_font }};
font-size:12px;
line-height:120%;
padding-top:20px;
padding-right:20px;
padding-bottom:20px;
padding-left:20px;
text-align:center;
}

#footerTable a:link, #footerTable a:visited, /*Y*/ #footerTable a .yshortcuts /*Y*/{
font-weight:normal;
text-decoration:underline;
}

.hs-image-social-sharing-24 {
max-width: 24px;
max-height: 24px;
}

/* ==== Standard Resets ==== */
.ExternalClass{
width:100%;
} /* Force Hotmail to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
line-height: 100%;
} /* Force Hotmail to display normal line spacing */
body, table, td, p, a, li, blockquote{
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%;
} /* Prevent WebKit and Windows mobile changing default text sizes */
table, td {
mso-table-lspace:0pt;
mso-table-rspace:0pt;
} /* Remove spacing between tables in Outlook 2007 and up */
img {
vertical-align: bottom;
-ms-interpolation-mode:bicubic;
} /* Allow smoother rendering of resized image in Internet Explorer */

/* Reset Styles */
body {
margin:0;
padding:0;
}
table {
border-collapse:collapse !important;
}
body, #backgroundTable, #bodyCell{
height:100% !important;
margin:0;
padding:0;
width:100% !important;
}
a:link, a:visited {
border-bottom: none;
}

/* iOS automatically adds a link to addresses */
/* Style the footer with the same color as the footer text */
#footer a {
color: {{ secondary_font_color }};;
-webkit-text-size-adjust: none;
text-decoration: underline;
font-weight: normal
}
/*]]>*/
</style>

<!--[if !mso]><!-- -->
<style type="text/css">
/*<![CDATA[*/
/* ==== Mobile Styles ==== */

/* Constrain email width for small screens */
@media screen and (max-width: 650px) {
table#backgroundTable {
width: 95% !important;
}

table#templateTable {
max-width:{{ email_body_width }}px !important;
width:100% !important;
}

table#contentTableInner {
max-width:{{ email_body_width }}px !important;
width:100% !important;
}

/* Makes image expand to take 100% of width*/
img {
width: 100% !important;
}

#contentCell {
padding: 10px 10px !important;
}

#headerTable {
padding-right: {{email_body_padding_num / 2 |int}}px !important;
}

#contentTableOuter {
padding: {{email_body_padding_num / 2 |int}}px !important;
}
}

@media only screen and (max-width: 480px) {
/* ==== Client-Specific Mobile Styles ==== */
body, table, td, p, a, li, blockquote{
-webkit-text-size-adjust:none !important;
} /* Prevent Webkit platforms from changing default text sizes */
body{
width:100% !important;
min-width:100% !important;
} /* Prevent iOS Mail from adding padding to the body */

/* ==== Mobile Reset Styles ==== */
td#bodyCell {
padding:10px !important;
}

/* ==== Mobile Template Styles ==== */

table#templateTable {
max-width:{{ email_body_width }}px !important;
width:100% !important;
}

table#contentTableInner {
max-width:{{ email_body_width }}px !important;
width:100% !important;
}

/* ==== Image Alignment Styles ==== */

h1, .h1 {
font-size:26px !important;
line-height:125% !important;
}

h2, .h2 {
font-size:20px !important;
line-height:125% !important;
}

h3, .h3 {
font-size:15px !important;
line-height:125% !important;
}

h4, .h4 {
font-size:13px !important;
line-height:125% !important;
}

h5, .h5 {
font-size:11px !important;
line-height:125% !important;
}

h6, .h6 {
font-size:10px !important;
line-height:125% !important;
}

.hide {
display:none !important;
} /* Hide to save space */

/* ==== Body Styles ==== */

td.bodyContent {
font-size:16px !important;
line-height:145% !important;
}

/* ==== Footer Styles ==== */

td#footerTable {
padding-left: 0px !important;
padding-right: 0px !important;
font-size:12px !important;
line-height:145% !important;
}

/* ==== Image Alignment Styles ==== */

table.alignImageTable {
width: 100% !important;
}

td.imageTableTop {
display: none !important;
/*padding-top: 10px !important;*/
}
td.imageTableRight {
display: none !important;
}
td.imageTableBottom {
padding-bottom: 10px !important;
}
td.imageTableLeft {
display: none !important;
}

/* ==== Column Styles ==== */

td.column {
display: block !important;
width: 100% !important;
padding-top: 0 !important;
padding-right: 0 !important;
padding-bottom: 0 !important;
padding-left: 0 !important;
}

td.columnContent {
font-size:14px !important;
line-height:145% !important;

padding-top: 10px !important;
padding-right: 10px !important;
padding-bottom: 10px !important;
padding-left: 10px !important;
}

#contentCell {
padding: 0px 0px !important;
}

#headerTable {
padding-right: {{email_body_padding_num / 2 |int}}px !important;
}

#contentTableOuter {
padding: {{email_body_padding_num / 2 |int}}px !important;
}
}
/*]]>*/
</style>
<!--<![endif]-->


{{ include_css("hubspot_default/shared/responsive/layout.css") }}
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
</head>
<body class="" style="#my-pretty-background-image-wrapper{ background-size:cover; background-position: center; }" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<!-- Preview text (text which appears right after subject) -->
<div id="preview_text" style="display:none;font-size:1px;color:{{background_color}};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">
{% text "preview_text" label="Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>", value="", no_wrapper=True %}
</div>

<!-- The backgroundTable table manages the color of the background and then the templateTable maintains the body of
the email template, including preheader & footer. This is the only table you set the width of to, everything else is set to
100% and in the CSS above. Having the width here within the table is just a small win for Lotus Notes. -->

<!-- Begin backgroundTable -->
<table align="center" bgcolor="{{ background_color }}" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
<tr>
<td align="center" valign="top" id="bodyCell"> <!-- When nesting tables within a TD, align center keeps it well, centered. -->
<!-- Begin Template Container -->
<!-- This holds everything together in a nice container -->
<table border="0" cellpadding="0" cellspacing="0" id="templateTable">
<tr>
<td align="center" valign="top">
<!-- Begin Template Preheader -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="headerTable">
<div class="header-container-wrapper">
<tr>
<td align="center" valign="top" class="bodyContent" width="100%" colspan="12">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
<tr>
<td valign="top" colspan=12 width="100.0%" class=" column" style="width:100.0%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; ">

<div class="widget-span widget-type-email_view_as_web_page " style="" data-widget-type="email_view_as_web_page">
{% if content.create_page %}
<div style="padding-top: 15px; font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; text-align: right; font-size: 9px; line-height: 1.34em; color: {{ secondary_font_color }}">
Not rendering correctly? View this email as a web page <a class="hubspot-mergetag" style="color: {{ secondary_font_color }}; text-decoration: underline; white-space: nowrap" data-viewaswebpage="true" href="{{ view_as_page_url }}">here</a>.
</div>

{% endif %}
</div><!--end widget-span -->
</td>
</tr>
</table>
</td>
</tr>
</div><!--end header wrapper -->
</table>
<!-- End Template Preheader -->
</td>
</tr>
<tr>
<td align="center" valign="top" id="contentCell">
<!-- Begin Template Wrapper -->
<!-- This separates the preheader which usually contains the "open in browser, etc" content
from the actual body of the email. Can alternatively contain the footer too, but I choose not
to so that it stays outside of the border. -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="contentTableOuter" style="{{email_body_border_css}}">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" id="contentTableInner">
<div class="body-container-wrapper">
<tr>
<td align="center" valign="top" class="bodyContent" width="100%" colspan="12">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
<tr>
<td valign="top" colspan=12 width="100.0%" class=" column" style="width:100.0%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; ">

<div class="widget-span widget-type-logo " style="text-align: center; " data-widget-type="logo">
<div class="layout-widget-wrapper">
{% logo "logo_image" img={suppress_company_name=True}, overrideable=True, suppress_company_name=True, label='Logo'%}
</div><!--end layout-widget-wrapper -->
</div><!--end widget-span -->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top" class="bodyContent" width="100%" colspan="12">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
<tr>
<td valign="top" colspan=12 width="100.0%" class=" column" style="width:100.0%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; ">

<div class="widget-span widget-type-custom_widget " style="border-color:#00446a;" data-widget-type="custom_widget">
<div class="layout-widget-wrapper">
{% module_block module "module_1544812458710177" background_image='{"src":"https://info.zoll.com/hubfs/Stock%20images/The%20Portland%20skyline%20and%20Hawthorne%20Bridge,%20in%20Portland,%20Oregon..jpeg","alt":"The Portland skyline and Hawthorne Bridge, in Portland, Oregon.","width":1000,"height":667}', module_id=4463121, overrideable=True, per_widget_wrapper_html='', widget_name='ZOLL Email Background Image Header Module', wrapping_html='', cta='<div style="text-align: center;">{{cta(\'c104219d-d928-4345-8801-359f821143e3\')}}</div>', label='ZOLL Email Background Image Header Module' %}
{% end_module_block %}
</div><!--end layout-widget-wrapper -->
</div><!--end widget-span -->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top" class="bodyContent" width="100%" colspan="12">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
<tr>
<td valign="top" colspan=12 width="100.0%" class=" column" style="width:100.0%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; padding:15px 0px 15px 0px;">

<table border="0" cellpadding="0" cellspacing="0" width="100%" style=" " class=" columnContentTable"><tr><td align="center" valign="top" class="columnContent widget-span widget-type-email_body" style="text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; padding:0px 75px 0px 75px;" data-widget-type="email_body">

{% content_attribute "email_body" %}<p>ZOLL Medical Corporation and the Salem, Oregon Fire Department invite you to attend Moving the Needle in Emergency Medicine, a two-day conference featuring thought leaders in the EMS Fire industry. You will learn new and innovative ways to approach cardiac arrest and mass tragedies, and additional topics to be announced. There will also be a <g class="gr_ gr_6 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="6" data-gr-id="6"><g class="gr_ gr_6 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="6" data-gr-id="6"><g class="gr_ gr_6 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="6" data-gr-id="6">hands on</g></g></g>&nbsp;experience with the Rialto Fire Department and their Cardiac Arrest Toolbox. Attendees will be eligible to earn CEUs; registration is free.</p>
<p>&nbsp;</p>
<p>{{cta('d36b1ea1-cf80-4655-a397-394aa69f93c9','justifycenter')}}</p>{% end_content_attribute %}
</td></tr></table><!--end widget-table -->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top" class="bodyContent" width="100%" colspan="12">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
<tr>
<td valign="top" colspan=12 width="100.0%" class=" column" style="width:100.0%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; ">

<table border="0" cellpadding="0" cellspacing="0" width="100%" style=" background-color:#f2f2f2;" class=" columnContentTable"><tr><td align="center" valign="top" class="columnContent widget-span widget-type-custom_widget" style="text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: 1.5em; color: {{ primary_font_color }}; " data-widget-type="custom_widget">

<div class="layout-widget-wrapper">
{% module_block module "module_1544813630260500" module_id=4194338, overrideable=True, per_widget_wrapper_html='', widget_name='ZOLL Email Footer New Design 2018', wrapping_html='', label='ZOLL Email Footer New Design 2018' %}
{% end_module_block %}
</div><!--end layout-widget-wrapper -->
</td></tr></table><!--end widget-table -->
</td>
</tr>
</table>
</td>
</tr>
</div><!--end body wrapper -->
</table>
</td>
</tr>
</table>
<!-- End Template Wrapper -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- Begin Template Footer -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="footerTable">
<div class="footer-container-wrapper">

</div><!--end footer wrapper -->
<tr>
{% hubspot_footer %}
</tr>
</table>
<!-- End Template Footer -->
</td>
</tr>
</table>
<!-- End Template Container -->
</td>
</tr>
</table>
</body>
</html>
0 Upvotes
1 Reply 1
Anonymous
Not applicable

Image aligning left in outlook

Hey @kleblanc,

 

Can you share screenshots of what your seeing, whether this is happening in other email clients, and what version of Outlook you're using? 

 

There is no styling that is going to work for everyone, and Outlook can be finicky. Try looking here as a start.