Hello and thank you for taking the time to look inside my post.
I am currently building an HTML email and I inherited some code to work with, my current issue is that there is a section on the email that was built using tags and they are not display correctly on several email services.
What other alternatives do I have for blockquote?? I have added my code below for your reference, I need to keep the same look but make it work. Thanks a lot!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Example Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="IE=edge">
<meta name="x-apple-disable-message-reformatting"> <!-- prevent automatic off-centered scaling in iOS -->
<style type="text/css">
#outlook a {
padding:0; /* trigger read in browser link in Outlook */
}
body, #bodyTable {
width:100% !important;
height: 100% !important;
-webkit-text-size-adjust:100%; /* disable auto-enlarge of text in mobile */
-ms-text-size-adjust:100%;
margin:0;
padding:0;
background-color:#eeeeee;
}
/* Outlook fixes */
/* Styles */
img, a img {
display: block; /* Remove extra space */
border: 0;
outline: none;
text-decoration: none;
-ms-interpolation-mode:bicubic; /* image resize fix for IE */
}
#main td, p, #subs td {
font-family: Arial,Helvetica,sans-serif;
font-size: 13px;
line-height: 22px;
color: #505050;
}
blockquote {
background:url('https://email.jmls.edu/USnews/2019/lawyering-skills/images/quote.png') left top no-repeat, url('https://email.jmls.edu/USnews/2019/lawyering-skills/images/endquote.png') right bottom no-repeat;
background-color:#f8f8f8;
padding: 30px 40px 30px 40px;
margin: 14px 30px;
}
blockquote p {
margin-top: 2px;
margin-bottom:2px;
font-weight:bold;
font-size:14px;
}
/* mobile-specific styles */
</style>
<table width="100%" id="bodyTable" border="0" cellpadding="0" cellspacing="0">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" id="main" style="background-color: #ffffff; border:1px solid #444444;">
<tbody>
<tr>
<td>
<tr>
<td style="padding: 10px 15px 20px;">
<blockquote><p>“It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.” </p>
<p style="text-align:right; font-weight:normal;">—Chicago </p></blockquote>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</td>
</tr>
</td>
</tr>
</tbody>
</table>
</table>
</head>
</html>
Related
I'm trying to build an email template based on https://www.muicss.com/docs/v1/example-layouts/html-email.
On top of what they offer, I'd like to have a two solid color background: color A for the top fixed height (say 200px), and color B for the rest of the content, and the table (cards) floating across the two colors, similar to This.
I tried different options using linear-background, but it doesn't show at all, the gradient starts from the bottom of the card, or the card's color becomes transparent when copied to Gmail web client (even after I inlined styles)
This is what I have for now:
<!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="width=device-width" />
<!-- NOTE: external links are for testing only -->
<style>
body {
width: 100% !important;
min-width: 100%;
margin: 0;
padding: 0;
background-color: #FFF;
}
.mui-body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
color: #212121;
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, "Trebuchet MS";
font-weight: 400;
font-size: 14px;
line-height: 1.429;
letter-spacing: 0.001em;
background-color: #FFF;
}
.mui-container, .mui-container-fixed {
max-width: 600px;
display: block;
margin: 0 auto;
clear: both;
text-align: left;
padding-left: 15px;
padding-right: 15px;
}
.mui-container-fixed {
width: 600px;
}
.mui-panel {
padding: 15px;
border-radius: 0;
background-color: #FFF;
border-top: 1px solid #ededed;
border-left: 1px solid #e6e6e6;
border-right: 1px solid #e6e6e6;
border-bottom: 2px solid #d4d4d4;
}
</style>
</head>
<body>
<table class="mui-body" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<center>
<!--[if mso]><table><tr><td class="mui-container-fixed"><![endif]-->
<div class="mui-container">
<table cellspacing="0" border="0" width="100%">
<tr>
<td class="mui-panel">
<table id="content-wrapper" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<p>random</p>
<p>text</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</center>
</td>
</tr>
</table>
</body>
</html>
Can someone help me with this please?
If only email clients decided to sit down and strictly follow the RFCs... If only they would use the same html css parsing engine...
The question isn't so much HOW but rather, WHAT type of html and css most email clients support consistently across the board. You will find most clients just do their own thing when it comes to parsing your emails and you could end up writing many templates from scratch for the same email.
To save you some time search Foundation for Emails on Google. See direct Link below.
Foundation for Emails | Responsive Email Templates
Foundation for emails is a framework that helps you develop your own custom email templates from templates they already have. Fluid & Responsive for any device. Very clean.
In the process, you will learn which CSS and HTML tags you can use and which aren't supported. Many aren't supported.. To give you an idea, html layouts in emails are created using <table></table> instead of <div></div>. The DOCTYPE you're using is also not ideal; think early 2000's.
Example of correct doctype for all universal emails you will ever write:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Email clients does not support all the css properties. So in short better you use images for linear gradient.
I'm putting together an html email and can't seem to get rid of bold text. As can be seen in the code provided below, nothing explains why my body text is confined to being bold. I have NO IDEA why this is the case, nothing in my code has enabled bold font. Does anyone happen to know why exactly this is the case? I'm not using a tag, no , and no font-weight. This is driving me crazy.
<html>
<head>
<meta charset="utf-8">
<!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>text</title>
<!-- CSS Reset -->
<style type="text/css">
html, body {
margin: 0 !important;
padding: 0 !important;
height: 100% !important;
width: 100% !important;
}
/* What it does: Stops email clients resizing small text. */
* {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
/* What it does: Forces Outlook.com to display emails full width. */
.ExternalClass {
width: 100%;
}
/* What is does: Centers email on Android 4.4 */
div[style*="margin: 16px 0"] {
margin: 0 !important;
}
/* What it does: Stops Outlook from adding extra spacing to tables. */
table, td {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
/* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
table {
border-spacing: 0 !important;
border-collapse: collapse !important;
table-layout: fixed !important;
margin: 0 auto !important;
}
table table table {
table-layout: auto;
}
/* What it does: Uses a better rendering method when resizing images in IE. */
img {
-ms-interpolation-mode: bicubic;
}
/* What it does: Overrides styles added when Yahoo's auto-senses a link. */
.yshortcuts a {
border-bottom: none !important;
}
/* What it does: Another work-around for iOS meddling in triggered links. */
a[x-apple-data-detectors] {
color: inherit !important;
}
</style>
<!-- Progressive Enhancements -->
<style type="text/css">
/* What it does: Hover styles for buttons */
.button-td,
.button-a {
transition: all 100ms ease-in;
}
.button-td:hover,
.button-a:hover {
background: #555555 !important;
border-color: #555555 !important;
}
/* Media Queries */
#media screen and (max-width: 600px) {
.email-container {
width: 100% !important;
}
/* What it does: Forces elements to resize to the full width of their container. Useful for resizing images beyond their max-width. */
.fluid,
.fluid-centered {
max-width: 100% !important;
height: auto !important;
margin-left: auto !important;
margin-right: auto !important;
}
/* And center justify these ones. */
.fluid-centered {
margin-left: auto !important;
margin-right: auto !important;
}
/* What it does: Forces table cells into full-width rows. */
.stack-column,
.stack-column-center {
display: block !important;
width: 100% !important;
max-width: 100% !important;
direction: ltr !important;
}
/* And center justify these ones. */
.stack-column-center {
text-align: center !important;
}
/* What it does: Generic utility class for centering. Useful for images, buttons, and nested tables. */
.center-on-narrow {
text-align: center !important;
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
float: none !important;
}
table.center-on-narrow {
display: inline-block !important;
}
}
</style>
</head>
<body bgcolor="white" width="100%" style="margin: 0;" yahoo="yahoo">
<table bgcolor="white" cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" style="border-collapse:collapse;">
<tr>
<td><center style="width: 100%;">
<!-- Visually Hidden Preheader Text : BEGIN -->
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;"> Title</div>
<!-- Visually Hidden Preheader Text : END -->
<!-- BEGIN -->
<table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="white" width="700" class="email-container"><br>
<!-- BODY - START -->
<tr>
<td>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="padding: 0px; font-family: Proxima Nova, sans-serif; font-size: 14px; line-height: 15px; color: black;">
<br>
<div style="max-width: 100%; max-height: 100%;">
<img src="" style="width: 25%; position: relative; margin-bottom: -12px;" align="left">
</div>
<!-- line break -->
<div align="center">
<hr height="1px" width="98%" color="#555555" align="center" style="display:inline-block;">
</div>
<br>
<br>
<!-- title --->
<div style="max-width: 100%; padding-left: 5px; position: relative;">
<h2>Text</h2>
<h3>Text</h3>
</div>
<br>
<br>
<br>
<!-- Image -->
<div style="max-width: 100%; max-height: 100%">
<img src="" width="100%" alt="text">
</div>
<br><br>
<u><h4>Text</h4></u>
<ul>
<li>Text</li><br>
<li>Text</li><br>
<li>Text</li><br>
<li>Text</li><br>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<br>
</center>
</td>
</tr>
</table>
</body>
</html>
Check the font families. I would say remove font-family: "Proxima Nova" and check it again. Try removing both proxima nova and sans-serif
maybe user agent stylesheet adds bold
font-weight: 100;
this will get rid of bold.
h3 {
font-weight: normal;
}
<h2>This TEXT is Bold</h2>
<h3>This TEXT is Normal</h3>
As per HTML standards h1,h2,h3..h6 considered as a heading so you can modify it as per your requirements.
I am creating a website for the first time and have run into an issue with the way my page is displayed in Internet Explorer. The page should have a banner with the logos of our sponsors as links to the sponsor's website. It works in Chrome, displaying like
this, a webpage with small, reasonably sized images for the logos. But in IE (version 11), it looks like this, a webpage where I can't even see the whole logo because it is so big. Can someone look at my code and tell me what to change (preferably in simple language since I am a beginner)? Thank you!
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>LTP | Home</title>
<meta name="description" content="Welcome to Language Training Programme">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none, default">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="styling.css" type="text/css" rel="stylesheet">
<!--WHY SPACING SOMETIMES WRONG??-->
</head>
<body>
<!--UNRELATED CODE-->
<table class="sponsors" width=100%>
<tr>
<td width=40%>
<h1>Thank You Sponsors</h1>
</td>
<td rowspan="2">
<img src="Po-Leung-Kuk-logo.png" height="10%">
</td>
<td rowspan="2">
<img src="UBS_logo_logotype_emblem.png" height="3.5%">
</td>
<!--LOOKS BAD IN EXPLORER??-->
</tr>
<tr>
<td class="chinesethankyou">
<h1>谢谢赞助商</h1>
</td>
<td></td>
<td></td>
</tr>
</table>
</body>
* {
margin: 0px;
}
h1 {
font-family:Arial;
color:white;
font-size:25px;
}
h2 {
font-family:Arial;
color:rgb(0,121,194);
font-size: 36px;
padding:20px 0px;
}
.tdlinks {
font-family:Arial;
color:rgb(144,38,143);
font-size: 1.5vw;
font-weight: bold;
padding-bottom: .7vw;
}
.tablelinks {
margin:30px 30px 5px 0px;
}
.sponsors {
background-color: rgb(144,38,143);
box-sizing: border-box;
width: 100%;
padding: 20px 30px;
}
p { /*line spacing*/
font-family:Arial;
color:black;
font-size:14px;
padding:10px 0px;
}
a,a:visited {
color: rgb(144,38,143);
text-decoration: none;
}
.line {
margin:0px 0px 0px 0px;
}
.chinesethankyou{
padding-top: 10px;
}
Getting things to work in other browsers besides chrome can be a little tricky. I recommend checking this site out, if you haven't already W3Schools. My best advice is use Google Chrome first and then move on to another browser. Google Chrome is pretty easy to use without having to do anything extra for its browser.
Setting image height and width will work
.sponsors img{
width: 150px;
height: 150px;
display: inline-block;
}
I am currently building an HTML email and I inherited some code to work with, my current issue is that there is a section on the email that was built using tags and they are not display correctly on several email services.
What alternatives do I have for blockquote? I have added my code below for your reference, I need to keep the same look but make it work.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Example Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="IE=edge">
<meta name="x-apple-disable-message-reformatting"> <!-- prevent automatic off-centered scaling in iOS -->
<style type="text/css">
#outlook a {
padding:0; /* trigger read in browser link in Outlook */
}
body, #bodyTable {
width:100% !important;
height: 100% !important;
-webkit-text-size-adjust:100%; /* disable auto-enlarge of text in mobile */
-ms-text-size-adjust:100%;
margin:0;
padding:0;
background-color:#eeeeee;
}
/* Outlook fixes */
/* Styles */
img, a img {
display: block; /* Remove extra space */
border: 0;
outline: none;
text-decoration: none;
-ms-interpolation-mode:bicubic; /* image resize fix for IE */
}
#main td, p, #subs td {
font-family: Arial,Helvetica,sans-serif;
font-size: 13px;
line-height: 22px;
color: #505050;
}
blockquote {
background:url('https://email.jmls.edu/USnews/2019/lawyering-skills/images/quote.png') left top no-repeat, url('https://email.jmls.edu/USnews/2019/lawyering-skills/images/endquote.png') right bottom no-repeat;
background-color:#f8f8f8;
padding: 30px 40px 30px 40px;
margin: 14px 30px;
}
blockquote p {
margin-top: 2px;
margin-bottom:2px;
font-weight:bold;
font-size:14px;
}
/* mobile-specific styles */
</style>
<table width="100%" id="bodyTable" border="0" cellpadding="0" cellspacing="0">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" id="main" style="background-color: #ffffff; border:1px solid #444444;">
<tbody>
<tr>
<td>
<tr>
<td style="padding: 10px 15px 20px;">
<blockquote><p>“It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.” </p>
<p style="text-align:right; font-weight:normal;">—Chicago </p></blockquote>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</td>
</tr>
</td>
</tr>
</tbody>
</table>
</table>
</head>
</html>
Does anyone know why the font color on iPad iOS 11.0, iPhone 7 iOS 11.0, iPhone X iOS 11.0.3 is blue? I tried to change the color in many ways but not working at all, I don't even have any blue color in my email code so it must be computed!
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="right" style="background: #333d47; text-align: left; color: #FFFFFF;">
<tr>
<td style="font-family:Arial, sans-serif;font-size: 12px; color: #FFFFFF; margin:0; padding:20px; font-weight: 300 !important;">Contact us now: <span editable="true" style="color: #FFFFFF;">+1(555) 555-555</span>
</td>
</tr>
</table>
iOS gives us x-apple-data-detectors to work around Apple Mail meddling with auto-detecting phone numbers and addresses and making them links. Placing something like this in your <style> tag should do the trick:
*[x-apple-data-detectors] {
border-bottom: 0 !important;
cursor: default !important;
color: inherit !important;
text-decoration: none !important;
}
This CSS solved the problem in most clients
*[x-apple-data-detectors], /* iOS */
.x-gmail-data-detectors, /* Gmail */
.x-gmail-data-detectors *,
.aBn {
border-bottom: 0 !important;
cursor: default !important;
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
iOS renders strings that it interprets as phone numbers as clickable links by default.
Use the format-detection meta tag and you can disable this feature:
<meta name="format-detection" content="telephone=no">
See: Supported Meta Tags
You need to just define color in span tag like given below
a { color: #FFFFFF !important; }
span { color: #FFFFFF !important; }
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="right" style="background: #333d47; text-align: left; color: #FFFFFF;">
<tr>
<td style="font-family:Arial, sans-serif;font-size: 12px; color: #FFFFFF; margin:0; padding:20px; font-weight: 300 !important;">Contact us now: <span editable="true" style="color: #FFFFFF;">+1(555) 555-555</span>
</td>
</tr>
</table>
Please try to add this to your site header
<meta name="format-detection" content="telephone=no" />
This happens as iOS detects phone numbers and turns them into links that people can click to call them. You can turn off the behavior by adding this in your section.