Académique Documents
Professionnel Documents
Culture Documents
0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>A Simple Responsive HTML Email</title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important;}
.content {width: 100%; max-width: 600px;}
</style>
</head>
<body yahoo bgcolor="#f6f8f1">
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td>
<table class="content" align="center"
cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
Hello!
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<style type="text/css">
@media only screen and (min-device-width: 601px) {
.content {width: 600px !important;}
}
</style>
and then in your CSS, add the padding for the header:
0
1
0
2
0
3
0
4 <tr>
0 <td class="innerpadding borderbottom">
5 <table width="100%" border="0" cellspacing="0"
cellpadding="0">
0 <tr>
6 <td class="h2">
0 Welcome to our responsive email!
7 </td>
0 </tr>
<tr>
8 <td class="bodycopy">
0 Lorem ipsum dolor sit amet, consectetur
9 adipiscing elit. In tempus adipiscing felis, sit amet blandit ipsum
1 volutpat sed. Morbi porttitor, eget accumsan dictum, nisi libero
0 ultricies ipsum,</td>
in posuere mauris neque at erat.
11 </tr>
1 </table>
2 </td>
1 </tr>
3
1
4
1
5
1
6
.innerpadding {padding: 30px 30px 30px 30px;}
.borderbottom {border-bottom: 1px solid #f2eeed;}
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-
weight: bold;}
.bodycopy {font-size: 16px; line-height: 22px;}
0 <tr>
1 <td class="innerpadding borderbottom">
<table width="115" align="left" border="0" cellpadding="0"
0 cellspacing="0">
<tr>
2 <td height="115" style="padding: 0 20px 20px 0;">
0 <img src="images/article1.png" width="115" height="115"
3 border="0" alt="" />
0 </td>
4 </tr>
</table>
0 <!--[if (gte mso 9)|(IE)]>
5 <table width="380" align="left" cellpadding="0"
0 cellspacing="0" border="0">
6 <tr>
0 <td>
<![endif]-->
7 <table class="col380" align="left" border="0" cellpadding="0"
0 cellspacing="0" style="width: 100%; max-width: 380px;">
8 <tr>
0 <td>
<table width="100%" border="0" cellspacing="0"
9 cellpadding="0">
1 <tr>
0 <td class="bodycopy">
11 Lorem ipsum dolor sit amet, consectetur adipiscing
1 elit. In tempus adipiscing felis, sit amet blandit ipsum volutpat
sed. Morbi porttitor, eget accumsan dictum, nisi libero ultricies
2 ipsum, in posuere mauris neque at erat.
1 </td>
3 </tr>
1 <tr>
4 <td style="padding: 20px 0 0 0;">
<table class="buttonwrapper" bgcolor="#e05443"
1 border="0" cellspacing="0" cellpadding="0">
5 <tr>
1 <td class="button" height="45">
6 <a href="#">Claim yours!</a>
</td>
1 </tr>
7 </table>
1 </td>
8 </tr>
1 </table>
</td>
9 </tr>
2 </table>
0 <!--[if (gte mso 9)|(IE)]>
2 </td>
</tr>
1
</table>
2 <![endif]-->
2 </td>
2 </tr>
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
3
2
3
3
3
4
3
5
3
6
3
7
3
8
3
9
4
0
4
1
4
2
4
3
4
4
4
5
Nous avons ajout un bouton ici avec la classe 'buttonwrapper'. Il contient
une cellule rembourre avec un jeu de couleurs de fond, puis un lien texte
l'intrieur. Je prfre utiliser cette mthode car elle vous permet d'avoir des
boutons de largeur fluide qui est trs utile lors de la cration d'un modle
rutilisable, o la largeur de chaque bouton sera diffrent chaque fois qu'il
est utilis. Si vous avez une largeur fixe pour vos boutons, vous pouvez
prfrer utiliser le Gnrateur de boutons Bulletproof sur Campaign Monitor.
.button {text-align: center; font-size: 18px; font-family: sans-serif;
font-weight: bold; padding: 0 30px 0 30px;}
.button a {color: #ffffff; text-decoration: none;}
As well as our set width for this new class 'col380', we'll add our size to our list of styles
to take care of Apple Mail. It now looks like this:
1 @media only screen and (min-device-width: 601px) {
2 .content {width: 600px !important;}
3 .col425 {width: 425px!important;}
4 .col380 {width: 380px!important;}
}
5
1<tr>
2 <td class="innerpadding borderbottom">
3 <img src="images/wide.png" width="100%" border="0" alt="" />
4 </td>
</tr>
5
In our CSS:
<tr>
1 <td class="innerpadding borderbottom">
2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In
tempus adipiscing felis, sit amet blandit ipsum volutpat sed. Morbi
3porttitor, eget accumsan dictum, nisi libero ultricies ipsum, in
4posuere mauris neque at erat.
5 </td>
</tr>
0 <tr>
<td class="footer" bgcolor="#44525f">
1 <table width="100%" border="0" cellspacing="0"
0 cellpadding="0">
2 <tr>
0 <td align="center" class="footercopy">
3 &reg; Someone, somewhere 2013<br/>
<a href="#"><font
0 color="#ffffff">Unsubscribe</font></a> from this newsletter
4 instantly
0 </td>
5 </tr>
0 <tr>
6
0
7
0
8
0
9
1
0
11
1
2
1
3
1 <td align="center" style="padding: 20px 0 0 0;">
4 <table border="0" cellspacing="0" cellpadding="0">
<tr>
1 <td width="37" style="text-align: center;
5 padding: 0 10px 0 10px;">
1 <a href="http://www.facebook.com/">
6 <img src="images/facebook.png"
1 width="37" height="37" alt="Facebook" border="0" />
</a>
7 </td>
1 <td width="37" style="text-align: center;
8 padding: 0 10px 0 10px;">
1 <a href="http://www.twitter.com/">
<img src="images/twitter.png"
9 width="37" height="37" alt="Twitter" border="0" />
2 </a>
0 </td>
2 </tr>
1 </table>
</td>
2 </tr>
2 </table>
2 </td>
3 </tr>
2
4
2
5
2
6
2
7
2
8
2
9
3
0
footer {padding: 20px 30px 15px 30px;}
.footercopy {font-family: sans-serif; font-size: 14px; color:
#ffffff;}
.footercopy a {color: #ffffff; text-decoration: underline;}
We'll have to strip the colour from the <td> to which it is currently applied, and then
apply it back to the <a> tag along with lots of padding.
I will use both max-width and max-device-width in this media query in an attempt to
avoid a bug in Outlook.com on IE9.