Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlook bg #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# email-html-essentials
# email-html-essentials:
-hide-on-desktop:

-outlook-bg: working example for background image and fallback font on Word based Outlooks (except Windows 10 Mail)
8 changes: 8 additions & 0 deletions outlook-background/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for better usage, delete the personal comments, because:
-it can break the email on some clients
-it enlarge the size of the html file

used this generator to create the background's VML code:
https://backgrounds.cm/


Binary file added outlook-background/step-1/img/cacti270.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outlook-background/step-1/img/propsize_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
176 changes: 176 additions & 0 deletions outlook-background/step-1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stable outlook background</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="https://fonts.googleapis.com/css?family=Nunito:400,700" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css?family=Nunito:400,700');
</style>
<style>
html,
body,
table,
tbody,
tr,
td,
div,
p,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
font-size: 0;
line-height: 0;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
table, td {
border-spacing: 0;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
table td {
border-collapse: collapse;
}
.ExternalClass {
width: 100%;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
/* Outermost container in Outlook.com */
.ReadMsgBody {
width: 100%;
}
img {
-ms-interpolation-mode: bicubic;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: Arial;
}
@font-face {
font-family: 'Nunito';
font-style: normal;
font-weight: 700;
src: local('Nunito Bold'), local('Nunito-Bold'), url(https://fonts.gstatic.com/s/nunito/v10/XRXW3I6Li01BKofAjsOUYevI.woff2) format('woff2');
}
h1 {
font-family: 'Nunito', sans-serif;
font-size: 28px;
line-height: 32px;
}
p, span, a {
font-size: 16px;
line-height: 20px;
font-family: Georgia, sans-serif;
}
.container600 {
width: 600px;
max-width: 100%;
}
@media all and (max-width: 600px) {
.container600 {
width: 100% !important;
}
}
@media all and (max-width: 599px) {
.reorder {
width: 100% !important;
}
}
</style>
<!--controllable fallback font on outlook-->
<!--[if mso]>
<style type=”text/css”>
.fallback-font {
font-family: Arial, sans-serif !important;
}
</style>
<![endif]-->

<!--fix dpi resizing issue-->
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
</head>
<body style="background-color:#F4F4F4;">
<center>
<!--[if gte mso 9]><table width="600" cellpadding="0" cellspacing="0"><tr><td>
<![endif]-->
<table class="container600" cellpadding="0" cellspacing="0" border="0" width="100%" style="width:calc(100%);max-width:calc(600px);margin: 0 auto; background:#20d1ac;">
<tr>
<td width="100%" style="text-align: center;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td background="https://github.com/blepati/bg_font_outlook/blob/master/img/propsize_bg.png?raw=true" bgcolor="#20d1ac;" width="100%" valign="top" style="background-position: center; background-repeat: no-repeat;">
<!--generetated background for outlook: https://backgrounds.cm/-->
<!--[if gte mso 9]>
<v:rect fill="true" stroke="false" style="width:600px; height:1000">
<v:fill type="tile" src="https://github.com/blepati/bg_font_outlook/blob/master/img/propsize_bg.png?raw=true" color="#20d1ac" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%" style="text-align: center; padding-top: 18px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px;">
<h1 class="fallback-font" style="font-family:'Nunito', Arial, sans-serif;color: #dedede; font-size: 28px; line-height: 32px;">Example header with cacti background</h1>
</td>
</tr>
<tr>
<td width="100%" style="text-align: center; padding-right: 20px; padding-bottom: 20px; padding-left: 20px;">
<p style="color: #dedede; font-size: 16px; line-height: 20px; font-family: Georgia, sans-serif;">Cacti occur in a wide range of shapes and sizes.
Most cacti live in habitats subject to at least some drought. Many live in extremely dry environments,
even being found in the Atacama Desert, one of the driest places on earth.</p>
</td>
</tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%" style="text-align: center; padding-top: 18px; padding-right: 20px; padding-bottom: 16px; padding-left: 20px;">
<h1 class="fallback-font" style="font-family:'Nunito', Arial, sans-serif; color: #dedede; font-size: 28px; line-height: 32px;">check text without background</h1>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if gte mso 9]></td></tr></table>
<![endif]-->
</center>
</body>
</html>
Loading