I have a custom typekit font used in an email signature with Georgia used as the fallback font.
On a mobile device, it will not fallback on Georgia. However, Georgia will load if I remove the custom font.
Am I missing anything?
<!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" />
<title>Signature</title>
<style type="text/css">
#import url("https://use.typekit.net/rzf8bdg.css");
body {
font-family: 'Bressay', Georgia, sans-serif;
font-weight: normal;
font-size: 12px;
text-align: left;
}
td {}
</style>
</head>
<body>
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 320px;">
<tr>
<td width="31.25%"><img src="https://fertilityconsultants.ca/wp-content/uploads/2018/11/cfc-logo-es.jpg" alt="CFC logo"/></td>
<td valign="center" style="padding-left: 10px;">
<strong style="font-size: 16px;">First Last Name</strong><br/>
<em style="font-size:12px; margin-bottom:6px;">Job position</em><br/>
<strong style="font-family: helvetica, arial, sans-serif; font-size: 10px; color: #66905f;">T</strong> (555) 555.5555 <strong style="font-family: helvetica, arial, sans-serif; font-size: 10px; color: #66905f;">EXT</strong> 555<br/>
<strong style="font-family: helvetica, arial, sans-serif; font-size: 10px; color: #66905f;">C</strong> (555) 555.5555<br/>
</td>
</tr>
</table>
</div>
</body>
</html>
Bressay is never going to work in Outlook or Gmail, since they don't work with web fonts like Google Fonts. I used your code and could not really tell if it was working for me or if it was Georgia, a web safe font that looks darn close. Here are some suggestions to make sure you always display a serif font for First Last Name.
In the head change your body declaration to remove the sans-serif backup:
body, table.body, td {
font-family: Bressay, Georgia, serif;
font-weight: normal;
font-size: 12px;
text-align: left;
}
Adobe does not use single quotes around the font name, try it without.
In addition to the body tag above, I also added table.body and td to the css. This will work with the parts where you wanted a sans-serif font instead.
I added the font-family tag directly to the strong tag in the signature.:
<strong style="font-family: bressay, Georgia, serif; font-size: 16px;">First Last Name</strong>
After doing this, I got a serif font in Gmail and Android.
I tested this in Litmus and it works fine for all desktop and mobile clients.
Good luck.
Related
I am rendering a html email template and i have a pre-wrapped text i want to show.
Using white-space: pre-wrap; works perfectly everywhere (gmail, yahoo...) except Outlook. I tried using <pre>/<pre> this also works perfectly everywhere (gmail, yahoo, even Outlook desktop app), but it doesn't work in Outlook web app.
Any suggestions what should i try next?
Code example 1:
<td style="color: #153643; font-family: Arial, sans-serif; font-size: 24px;">
<div style="white-space: pre-wrap; text-align: left; font-weight: bold" th:text="${content}"></div>
</td>
Code example 2:
<td style="color: #153643; font-family: Arial, sans-serif; font-size: 24px;">
<pre style="text-align: left; font-weight: bold" th:text="${content}"></pre>
</td>
Best way forward probably is then to use Outlook conditional code, i.e.:
<td style="color: #153643; font-family: Arial, sans-serif; font-size: 24px;">
<!--[if !mso]><!-- --><div style="white-space: pre-wrap; text-align: left; font-weight: bold" th:text="${content}"></div><!--<![endif]-->
<!--[if mso]><!-- --><pre style="text-align: left; font-weight: bold" th:text="${content}"></pre><!--<![endif]-->
</td>
I have a emailTemplate that I want to have a light background.
But Outlook in darkMode messes the css up. Sure there is a switch in outlook to "turn the ligths on" but I want to have white background all the time because everyone that gets the email will not know how to do that switch.
I have tried to add bgcolor to the table tag and the td tag and added backgroundColor to inline style, but without success.
I have also tried to force the button to have the same yellow color in darkmode, but it switches no matter what.
I have also tried to search the internet but cant anything that covers outlook darkmode.
https://litmus.com/blog/email-designers-next-challenge-apple-dark-mode
<table bgcolor="#ffffff" style="width:70%;" align="center" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td bgcolor="#ffffff">
<tr>
<td align="center" style="
display: inline-block;
background-color: #ffdd00;
border-radius: 3px;
padding: 18px 0px;
width: 100%;
text-align: center;
cursor: pointer;
">
<a href="https://my.hogia.se" target="_blank" style="
text-decoration: none;
text-transform: uppercase;
color: #000;
font-family: Lato, Trebuchet, Verdana, Tahoma, Lucida Sans Unicode, Arial;
font-weight: 700;
font-size: 14px;
letter-spacing: 0.0625em;">Kom igång</a>
</td>
</tr>
StandardMode:
DarkdMode:
Outlook365 and Outlook.com dark mode can't be overridden because Microsoft adds !important inline to every background color it finds including the system. I think they added this in June 2021.
I'm setting up a new email signature for my client which needs to be responsive .
I tried out one layout which includes div , tables etc which works out good on desktops but not on mobiles .
Below is one such sample but the email appears as same is desktop & mobile with the cells / divs shifting one under the other .
As a part of my research , i tried using this email boilerplate which ended up in the same way . - https://github.com/seanpowell/Email-Boilerplate
<!--[if gte mso 9]>
<table cellspacing=0><tr><td style="font-family: Arial; font-size: 10pt; color: #fff; background-color: orange; width: 250px; height: 100px; padding: 3px; vertical-align: top">
<![endif]-->
<div style="float: left; font-family: Arial; font-size: 10pt; color: #fff; background-color: orange; width: 250px; height: 100px; padding: 3px; vertical-align: top">
<strong>Administrator</strong><br>Phone {qwfqwfcqwdqwfqfgqwfqwbfjqnwjkfqnwjfbqiwnf qwnfiquwnqwnfiqnwifjnqwfinqwifnqwjinfqjiwnfijqwnf}<br>Email {qwfqwfqwcqwfqwfqwfdqwcrqwrqwcrqwrqwrcqwrxqwrqwcxqrwqxrqwxqwx}
</div>
<!--[if gte mso 9]>
</td><td style="font-family: Arial; font-size: 10pt; color: #fff; background-color: red; width: 250px; height: 100px; padding: 3px; vertical-align: top">
<![endif]-->
<div style="float: left; font-family: Arial; font-size: 10pt; color: #fff; background-color: red; width: 250px; height: 100px; padding: 3px; vertical-align: top">
<strong>qwfqwfqwdqw fqwfqwfqwdfqwdqwfqwfqwdqwdqwdqw</strong>
</div>
<!--[if gte mso 9]>
</td></tr></table>
<![endif]-->
https://jsfiddle.net/623y57p1/1/
Have a look at the demo i made . This is responsive in browsers , but not in outlook .
I created a sample code that works with Outlook. The two columns of this email footer will display side-by-side if the viewing window is wider than 580px. If it goes below that width, it will revert to two stacked columns. You can set the width breakpoint by adjusting <td width="290">.
<table align="center" role="contentinfo" cellspacing="0" cellpadding="0" border="1" width="100%" style="margin: 0 auto;">
<tr>
<td width="290" style="direction: ltr !important; display: inline-block;">
Column A
</td>
<td width="290" style="direction: ltr !important; display: inline-block;">
Column B
</td>
</tr>
</table>
Please keep in mind a few caveats:
Outlook 2007-2019 does not support responsive email. There is no support for #media queries.
The width for the table must be set to <table width="100%">.
The width for the table cells to 290 because the maximum width for an Outlook viewing window is 580px.
You can turn off <table border="1"> It's on for demonstration purposes.
<table role="contentinfo"> supports screen readers. Please leave it to help visually impaired users know about the structure of your email message.
https://jsfiddle.net/wallyglenn/w0s4xmc0/60529/
Good luck.
I have created a report which, when generated in pdf or docx format, looks the way I want it to. However, when I generate the report in HTML format, the resulting document is ruined. Embedded images are missing, field formatting for tables differs from the one in pdf or docx, a separate block for page background is generated, a lot of <img alt="" src="nullpx"/> tags are generated:
<tr valign="top">
<td><img alt="" src="nullpx" style="width: 20px; height: 19px;"/></td>
<td colspan="4"><p style="overflow: hidden; line-height: 1.0; text-indent: 0px; "><span style="font-family: 'Times New Roman', Arial, Helvetica, sans-serif; color: #000000; font-size: 14px; font-weight: bold;">Common information</span></p></td>
<td colspan="5"><img alt="" src="nullpx" style="width: 168px; height: 19px;"/></td>
<td colspan="2"><img alt="" src="nullpx" style="width: 20px; height: 19px;"/></td>
</tr>
This is how the HTML version looks:
and this is the docx version:
Any ideas why this may be happening?
For whatever reason my text resizing is not working on iPhones, working fine on android, and in another email format. Can't seem to see any differences between the two files. The images also resize, seems to just be an issue with the text.
<head>
<style type="text/css">
/* Outlook link fix */
#outlook a {padding:0;}
/* Hotmail background & line height fixes */
.ExternalClass {width:100% !important;}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font,
.ExternalClass td, .ExternalClass div {line-height: 100%;}
/* Image borders & formatting */
img {outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;}
a img {border:none;}
/* Re-style iPhone automatic links (eg. phone numbers) */
.applelinks a {color:#222222; text-decoration: none;}
/* Hotmail symbol fix for mobile devices */
.ExternalClass img[class^=Emoji] { width: 10px !important; height: 10px !important; display: inline !important; }
/* Media Query for mobile */
#media screen and (max-width: 480px) {
/* This resizes tables and images to be 100% wide with a proportionate width */
table[class=emailwrapto100pc], img[class=emailwrapto100pc]{width:100% !important; height:auto !important;}
/* Hide stuff on mobiles */
table[class=emailnomob],td[class=emailnomob],img[class=emailnomob],span[class=emailnomob]{display:none !important;}
td[class=emailcolsplit]{width:100%!important; float:left!important;}
a[class=emailmobbutton]{display:block !important;font-size:14px !important; font-weight:bold !important; padding:6px 4px 8px 4px !important; line-height:18px !important; background:#dddddd !important; margin:10px auto;width:100%; text-align:center; color:#111 !important; text-decoration:none; text-shadow:#fff 1px 0 0 ;}
/* This resizes body text for mobiles */
span[class=emailbodytext],a[class=emailbodytext]{font-size:16px !important; line-height:21px !important;}
}
#media screen and (min-width:1024px) {
a[class=emailmobbutton]{display: none !important;}
span[class=emailmobbutton]{display: none !important;}
}
<table style="padding-top:20px;" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href="" target="_blank">
<img height="216" width="216" border="0" src="" style="display: block;" class="emailwrapto100pc" />
</a>
</td>
</tr>
<tr>
<td align="center" style="padding-top:10px;padding-left:10px;padding-right:10px;">
<a href="" style="text-decoration: none; color: #111111">
<span class="emailbodytext" style="font-size:12px; font-family:tahoma, sans-serif; line-height:20px; color:#333333;">Hugo Boss Black</span>
</a>
</td>
</tr>
<tr>
<td width="33%" align="center" style="padding-top:5px;padding-bottom:10px;padding-left:10px;padding-right:10px;">
<a href="" style="text-decoration: none; color: #111111">
<span class="emailbodytext" style="font-size:12px; font-family:tahoma, sans-serif; line-height:20px; color:#333333;">Bugnara Polo T-Shirt</span>
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a style="text-decoration:none;background-color:#000000; color:#ffffff; padding:5px 20px; font-family:tahoma, sans-serif;font-size:12px;line-height:20px;" href="">
SHOP NOW</a>
</td>
</tr>
</table>
Any help would be greatly appreciated.
I have ran into an issue where I was working with email provider that did not allow modifications in
<head>
section, and my one
<style> #media ...</style> code did not work.
With email we have to think back rather than forward in time. Try writing you media query as a separate block section. I've tried this method & it worked without a hitch on Android, where the previous method failed.
`<style type="text/css">
/* standard styles */
</style>
<style media="screen and (max-width: 480px)">
/* responsive styles */
</style>`
Hope this helps you out.