I currently have this layout for a HTML email I am creating:
I am trying to move the text so that it starts from the start of the image (essentially, move the text up) and then, create a gap of around 10px between the text and the red download button.
The issue is I'm struggling to address this using tables which are essential for HTML emails.
This is what I have so far:
<table cellpadding="0" cellspacing="0" border="0" width="600" bgcolor="#0066cb">
<tbody>
<tr>
<td height="240" width="15"><!-- PADDING (CREATING AREA) --></td>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td height="10"><!-- PADDING --></td>
</tr>
<tr>
<td>
<!-- IMAGE -->
<img src="images/unnamed (4).png"height="250" style="display:block;" border="0" />
</td>
<td style="font-family:Arial;font-size:27px;line-height:35px;color:#ffffff;">
eguide title lorum ipsum <br>
dolor sit amet labore et
<img src="images/unnamed (5).png" alt="test" style="display:block;" border="0" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
JSFiddle: https://jsfiddle.net/7bzgpd02/
Added this code to your inline style on the table field containing the "eguide" text (tables usually default to vertically centered until directed otherwise):
vertical-align: top;
See the below example, it now works:
* {
border: 1px solid red;
}
<table cellpadding="0" cellspacing="0" border="0" width="600" bgcolor="#0066cb">
<tbody>
<tr>
<td height="240" width="15"><!-- PADDING (CREATING AREA) --></td>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td height="10"><!-- PADDING --></td>
</tr>
<tr>
<td>
<!-- IMAGE -->
<img src="http://placehold.it/100x100" alt="Xenith" height="250" style="display:block;" border="0" />
</td>
<td style="font-family:Arial;font-size:27px;line-height:35px;color:#ffffff; vertical-align: top;">eguide title lorum ipsum <br>
dolor sit amet labore et
<img src="images/unnamed (5).png" alt="test" style="display:block;" border="0" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Related
I have made an html template that works almost perfectly except images suddenly do not appear in outlook online.
The appear to be reduced to a 1px width and height.
I have set the widths in the inline styles, but not the heights as I would like the client to have the flexibility of an auto height. The problem also occurs even when I have set a width and height.
This works fine except for outlook and I cannot work out why.
here is the code from on of the sections, though this happens to every image in the template.
I have checked that images are not turned off in my email settings
<table width="650" style="table-layout:fixed;margin-left:auto;margin-right:auto;" border="0" align="center" cellpadding="0" cellspacing="0" class="wrapper" mc:repeatable mc:variant="half and half white">
<tr>
<td align="left">
<table width="650" class="wrapper" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff">
<tr>
<td align="left">
<table width="324" border="0" align="left" cellpadding="0" cellspacing="0" class="wrapper">
<tr>
<td class="pad_top_split" width="324" align="center" valign="top">
<img src="https://gallery.mailchimp.com/85d3e81373f3d7582fcc72bdb/images/ec03eb0f-61aa-4c51-8efd-621054f0652c.jpg" width="324" class="full_img" alt="Flush image 2" style="display:block; max-width:324px;" border="0" mc:edit="324_images2">
</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
<td valign="top">
<![endif]-->
<table width="286" border="0" align="right" cellpadding="0" cellspacing="0" class="wrapper" bgcolor="#ffffff">
<tr>
<td valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="pad_side">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" class="fix_height"> </td>
</tr>
<tr>
<td class="white" style="font-family:Arial, sans-serif;font-size:14px;letter-spacing:4px;line-height:34px;color:#000000;" mc:edit="text_2">Lorem ipsum text</td>
</tr>
<tr>
<td height="7" style="line-height:0px;font-size:0px;"> </td>
</tr>
<tr>
<td class="white" style="font-family:Arial, sans-serif;font-size:15px;background-color:#ffffff;line-height:25px;color:#000000;" mc:edit="para_2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque vitae interdum ligula. Pellentesque feugiat ligula ligula, in interdum dolor aliquet et. </td>
</tr>
<tr>
<td height="32" class="fix_height"> </td>
</tr>
</table>
</td>
<td width="30" class="hide">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
http://imgur.com/a/fKv2H
I need banner with height 100px. and img inside it with height 120px. So the picture comeee out my banner for 20px;
Its for emails.
Also i need text column right before picture, so that text in column with background f4f4f4
<table>
<tr>
<td>
<img src="" style="margin-top:-20px;" />
</td>
<td>
banner text here
</td>
</tr>
</table>
You can do this two ways, one involved slicing the image into two and the other is using two more tables. I have added the code below for you to decide which one you want to go with.
Option 1:
This option has the image as one piece sitting in an outer table with 3 columns. The outer two columns have a table with white background to cater for the heads/hats popping out of the grey area. I have set the table width at 100% to show it will look.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" bgcolor="#f4f4f4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td bgcolor="#ffffff" style="height: 23px;" height="23"></td>
</tr>
</tbody>
</table>
</td>
<td width="171" valign="top"><img src="http://i67.tinypic.com/sdk1hh.jpg" width="171" height="178" style="display: block;"></td>
<td valign="top" bgcolor="#f4f4f4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td bgcolor="#ffffff" style="height: 23px;" height="23"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Option 2
For this option, you will need to slice the top part of the image (with white background) and place both the images in one table with two rows. Both images are centered and I have set the table width at 100% to show it will look.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="top" bgcolor="#ffffff"><img src="http://i64.tinypic.com/lz7f6.png" style="display: block;">
</td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#f4f4f4"><img src="http://i68.tinypic.com/4qo1mu.png" style="display: block;"></td>
</tr>
</tbody>
</table>
The final outcome for both codes should look like this:
Let me know which option best suits you.
** UPDATE **
Your question asked if you can have option 1 with image to the left and text on the right, here is the example:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="171" valign="top" style="padding-left:20px;"><img src="http://i67.tinypic.com/sdk1hh.jpg" width="171" height="178" style="display: block;"></td>
<td valign="top" bgcolor="#f4f4f4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td bgcolor="#ffffff" style="height: 23px;" height="23"></td>
</tr>
<tr>
<td style="font-family:Arial; font-size:12px; color:#000000; padding:5px 10px;">This is some text for your email</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
I added colors so you could see that it was outside the table. I gave the image a height of 120px, width of auto. Made the td's have a max-height of 100px; And I left your -20px margin on the image.
<body style="background-color:pink">
<table style="background-color:orange;">
<tr>
<td style="max-height:100px; overflow-y:initial;">
<img src="https://i.imgur.com/ZESO4DT.png" style="margin-top:-20px; height:120px; width:auto;" />
</td>
<td style="max-height:100px;overflow-y:initial;">
banner text here
</td>
</tr>
</table>
</body>
Currently working on coding for Email:
I am trying to get this button (created out of tables) to align to the bottom of the enclosing table. At the moment it will not align and I'm not sure why.
<table width="300" min-width="300" height="500" class="promo_3" align="left">
<tr>
<td valign="top">
<a target="_blank" href="http://www.thing.html">
<img class="promo" alt="Promo image 2" src="http://media.campaigner.com/image1.jpg">
</a>
<br>
<br>
<h1> TRAINING </h1>
<span valign="top" class="content">TITLE HERE</span>
<p>TEXT HERE</p>
<br>
<!--Button THIS WILL NOT ALIGN TO THE BOTTOM -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-bottom:20px;">
<tr>
<td height="20">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#f55926" valign="bottom" style="padding: 8px 30px 8px 30px; -webkit-border-radius:3px; border-radius:3px" align="center">Read More
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Button + Social End -->
</td>
</tr>
</table>
Maybe give this method a try:
<table width="300" min-width="300" height="500" class="promo_3" align="left">
<tr>
<td valign="bottom"><br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="200" valign="top"><a target="_blank" href="http://www.thing.html"><img class="promo" alt="Promo image 2" src="http://media.campaigner.com/image1.jpg"></a></td>
</tr>
<tr>
<td height="200" valign="top">
<h1> TRAINING </h1>
<span valign="top" class="content">TITLE HERE</span>
<p>TEXT HERE</p>
</td>
</tr>
</tbody>
</table>
<br>
<!--Button THIS WILL NOT ALIGN TO THE BOTTOM -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-bottom:20px;">
<tr>
<td height="20">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#f55926" valign="bottom" style="padding: 8px 30px 8px 30px; -webkit-border-radius:3px; border-radius:3px" align="center">Read More
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Button + Social End -->
</td>
</tr>
</table>
What I have done is added one table with two rows, both the rows have specific height with content aligned top. Some email clients are notorious and might not align the code to the bottom as it is on the code, for those email clients you can use padding-top on the TD's. Hope this helps.
Cheers
This is what you are looking for? Just add align='left' to table containing button.
<table width="300" min-width="300" height="500" class="promo_3" align="left">
<tr>
<td>
<a target="_blank" href="http://www.thing.html">
<img class="promo" alt="Promo image 2" src="http://media.campaigner.com/image1.jpg">
</a>
<br>
<br>
<h1> TRAINING </h1>
<span valign="top" class="content">TITLE HERE</span>
<p>TEXT HERE</p>
<br>
<!--Button THIS WILL NOT ALIGN TO THE BOTTOM -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-bottom:20px;">
<tr>
<td height="20">
<table border="0" align='left' cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#f55926" valign="bottom" style="padding: 8px 30px 8px 30px;-webkit-border-radius:3px; border-radius:3px" align="center">Read More
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Button + Social End -->
</td>
</tr>
</table>
Iam tying to create an newsletter, but in outlook mobile it does not pick up the correct styling. The styling which is not picked up is as follow: bold text, color of text and uppercase
Here a link to the output
The titles like Folio .... needs to be blue and bold.
thereby the text in buttons needs to be white and bold.
And the text in de full width button has to be uppercased and white
here is the html of an element with the image left text right:
<!-- // Begin Module: [Dark] Image left text right \\ -->
<table class="responsive-table" width="650" bgcolor="#d1d6e1" border="0" cellpadding="0" cellspacing="0" align="top" mc:repeatable="trading" mc:variant="[Dark] Image left text right">
<tbody>
<tr>
<td width="5%"></td>
<td width="90%" align="center">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td width="650" height="30"></td></tr>
<tr>
<td width="35%" align="center" valign="top" class="mobile-width-100" mc:label="image" mc:edit="iltrdimage">
<a href="#" target="_blank">
<img src="http://placehold.it/800x538" width="230" style="text-decoration: none;">
</a>
</td>
<td width="5%" class="mobile-height-30"></td>
<td width="60%" align="left" valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-bottom: 5px;" mc:label="body title" md:hideable="" mc:edit="iltrdbodytitle">
<a href="#" class="block-title" style="font-family: 'OpenSans', Arial; font-size: 16px !important;line-height: 18px;color: #224691; text-decoration: none; font-weight: 700;" mc:label="heading">
<font color="#224691">Title</font>
</a>
</td>
</tr>
<tr>
<td style="padding-bottom: 10px;" mc:label="body text" mc:edit="iltrdbodytext">
<span style="font-family: 'OpenSans', Arial; color: #323232;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer pharetra hendrerit felis, eget auctor ex tincidunt eget. Vestibulum consequat quam nibh.
</span></td>
</tr>
</table>
<table bgcolor="#2f57ad" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" class="btn">
<table cellpadding="0" cellspacing="0">
<tr>
<td mc:label="button" mc:edit="iltrdbutton">
<font color="#ffffff">Read more</font>
</td>
<td style="padding-left: 10px; padding-top: 1px;"><span style="font-size: 13px; color: #fff;">▸</span></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr><td width="650" height="30"></td></tr>
</tbody>
</table>
</td>
<td width="5%"></td>
</tr>
</tbody>
</table>
<!-- // End Module: [Dark] Image left text right \\ -->
outlook does not support all css please go have a look at https://www.campaignmonitor.com/css/
outlook versions just as ie have different css to consider so you would need something like this to cater for all the options
<!--[if gte mso 9]>
<style type="text/css">
/* Your Outlook-specific CSS goes here. */
</style>
<![endif]-->
The text I have on top in the table row is somehow affected by the second column below it..cant seem to have it take up the entire width of the table.
http://jsfiddle.net/PmWBw/2/
Sorry I know I am the only one still working in tables. HTML emails still exist.
<table width="800" class="bodyContent" style="border: 1px solid #b8b7b7;margin-bottom: 20px;">
<table>
<tr style="width: 800px;">TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXT</tr>
</table>
<td valign="top" width="260" class="leftColumnContent">
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr mc:repeatable>
<td valign="top">
<img src="http://www.homeplan.com/newsletter/images/top_left.png" mc:label="image" mc:edit="tiwc300_image00" />
</td>
</tr>
</table>
</td>
<td valign="top" width="260" class="rightColumnContent">
<!-- // Begin Module: Top Image with Content \\ -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr mc:repeatable>
<td valign="top">
<img src="http://www.homeplan.com/newsletter/images/top_right.png" mc:label="image" mc:edit="tiwc300_image01" />
</td>
</tr>
</table>
</td>
</table>
For starters, your first row consists of a td inside a tr that's inside ANOTHER td. If nothing else, that should probably be addressed.
Also, a bit unrelated to you original question, but it seems a bit redundant to have tables inside of your cells, when I'm not seeing any real benefit or function gained by the added code. You're styling your inner tables with the same things you can be applying to either the td or the image itself. At least in this particular application.
Just a thought.
UPDATED:
<table width="600" class="bodyContent" style="border: 1px solid #b8b7b7;margin-bottom: 20px;">
<tr>
<td colspan="2">
<table>
<tr style="width: 600px;">
<td>TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXT</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="260" class="leftColumnContent">
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr mc:repeatable>
<td valign="top">
<img src="http://www.homeplan.com/newsletter/images/top_left.png" mc:label="image" mc:edit="tiwc300_image00" />
</td>
</tr>
</table>
</td>
<td valign="top" width="260" class="rightColumnContent">
<!-- // Begin Module: Top Image with Content \\ -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr mc:repeatable>
<td valign="top">
<img src="http://www.homeplan.com/newsletter/images/top_right.png" mc:label="image" mc:edit="tiwc300_image01" />
</td>
</tr>
</table>
</td>
</tr>
</table>
First of all, you can not have the code looking like this:<td><tr><td>asdf</td></tr></td>. It the <tr> needs to be wrapped by <table>.