Diagonal border line with (inline) CSS - html

I would like to have a white diagonal stripe with css. I have tried something but I don't get it work. I will put the link in here as well so you can have a look.
Is there anyone who can help me out?
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="wrapper-section-one editable">
<tbody>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td>
<table width="300" border="0" cellspacing="0" cellpadding="0" align="left" style="background: black; outline: none; outline-offset: 2px; border: 10px solid white; height: 90px;
background-image: linear-gradient(to bottom right, black, black 50%, white 50%, white); " class="wrapper-section-one editable bg-editable" data-selector="table.bg-editable">
<tbody>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="text-align:center;">
<img src="images/blank.gif" width="1" height="27" alt="" title="">
</td>
</tr>
<tr>
<td height="20">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:14px;color:#ffffff;text-transform:uppercase;text-align:center;font-weight:bold;">
<br/>
</td>
</tr>
<tr>
<td height="10">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:13px;color:#ffffff;text-transform:capitalize;text-align:center;">
</td>
</tr>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
</tbody>
</table>
<table width="300" border="0" cellspacing="0" cellpadding="0" align="right" style="background: #c11717; outline: none; outline-offset: 2px; border: 10px solid white;" class="wrapper-section-one editable bg-editable" data-selector="table.bg-editable">
<tbody>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="text-align:center;">
<img src="images/mark.png" width="17" height="27" alt="" style="display:initial;" data-selector="div.editable img">
</td>
</tr>
<tr>
<td height="20">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:14px;color:#ffffff; text-transform:uppercase;text-align:center;font-weight:bold;">
Kop 1
</td>
</tr>
<tr>
<td height="10">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:13px;color:#ffffff; text-transform:capitalize;text-align:center;">
Tekst 1
</td>
</tr>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table width="300" border="0" cellspacing="0" cellpadding="0" align="left" style="background: #c11717; outline: none; outline-offset: 2px; border: 10px solid white;" class="wrapper-section-one editable bg-editable" data-selector="table.bg-editable">
<tbody>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="text-align:center;">
<img src="images/icon_date.png" width="27" height="27" alt="" style="display:initial;" data-selector="div.editable img">
</td>
</tr>
<tr>
<td height="20">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:14px;color:#ffffff; text-transform:uppercase;text-align:center;font-weight:bold;">
Kop 2
</td>
</tr>
<tr>
<td height="10">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:13px;color:#ffffff; text-transform:capitalize;text-align:center;">
Tekst 2
</td>
</tr>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
</tbody>
</table>
<table width="300" border="0" cellspacing="0" cellpadding="0" align="right" style="background: black; outline: none; outline-offset: 2px;border: 10px solid white;" class="wrapper-section-one editable bg-editable" data-selector="table.bg-editable">
<tbody>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="text-align:center;">
<img src="images/wclock.png" width="24" height="27" alt="" style="display:initial;" data-selector="div.editable img">
</td>
</tr>
<tr>
<td height="20">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:14px;color:#ffffff;text-transform:uppercase;text-align:center;font-weight:bold;">
Kop 3
</td>
</tr>
<tr>
<td height="10">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
<tr>
<td style="font-size:13px;color:#ffffff;text-transform:capitalize;text-align:center;">
Tekst 3
</td>
</tr>
<tr>
<td height="50">
<img src="images/blank.gif" width="1" height="1" alt="" title="">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

Here's a copy of your image using the linear-gradient CSS approach. MUCH less markup required :)
div#wrapper {
float: left;
width: 220px;
height: 220px;
margin: 0px;
}
div#wrapper div {
width: 100px;
height: 100px;
float: left;
background: red;
margin: 0px 10px 10px 0px;
}
div#wrapper #d1 {
background-image: repeating-linear-gradient(145deg, black, black 60px, white 60px, white 80px);
}
div#wrapper #d4 {
background: black;
}
<div id="wrapper">
<div id="d1"></div>
<div id="d2"></div>
<div id="d3"></div>
<div id="d4"></div>
</div>

Here is my approach to get the result exactly as in your example image link, but it doesn't work for emails.
.box {
position: relative;
margin: 0 15px 15px 0;
width: 100px;
height: 100px;
float: left;
}
.cf {
clear: left;
}
.box--red {
background-color: #ff0000;
}
.box--black {
background-color: #000000;
}
.box--split:before {
content: "";
position: absolute;
border-top: 50px solid #000;
border-right: 50px solid transparent;
border-left: 50px solid #000;
border-bottom: 50px solid transparent;
box-sizing: border-box;
}
.box--split:after {
content: "";
position: absolute;
right: 0;
bottom: 0;
display: block;
box-sizing: border-box;
border-right: 40px solid #000;
border-top: 40px solid transparent;
border-bottom: 40px solid #000;
border-left: 40px solid transparent;
}
<div class="box box--split">
</div>
<div class="box box--red">
</div>
<div class="box box--red cf">
</div>
<div class="box box--black">
</div>

Related

Put social media div in the web page center

I am trying to put the social media icones of my website in the page center.
But I couldn't.
This is my code:
https://jsfiddle.net/2ahgL130/1/
CSS:
.table1{
margin:0;
padding:0;
min-width:100%
}
.table2{
font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
font-size:1em;
line-height:1.5;
max-width:600px;
padding:0 20px 0 20px;
}
.table3{
padding:20px;
}
.table4{
padding-bottom:20px;
padding-top: 0px;
align-items: center;
}
.table5{
padding-bottom:20px;
}
So please how can I correct my code to get the elements in the page center
You have to update your entire code and use below snippet using flexbox.
html,
body {
height: 100%;
padding: 0;
margin: 0;
}
.container {
width: 100%;
height: 100%;
background-color: #ccc;
display: flex;
justify-content: center;
align-items: center;
}
<div class="container">
<a href="" target="_blank" data-saferedirecturl="">
<img src="https://dummyimage.com/32x32/000/fff" width="32" height="32">
</a>
<a href="" target="_blank" data-saferedirecturl="">
<img src="https://dummyimage.com/32x32/000/fff" alt="" width="32" height="32">
</a>
</div>
You can use this code
body {
margin: 0;
padding: 0;
}
.table1 {
margin: 0;
padding: 0;
min-width: 100%
}
.table2 {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1em;
line-height: 1.5;
max-width: 600px;
padding: 0 20px 0 20px;
margin: 0 auto;
}
.table3 {
padding: 20px;
}
.table4 {
padding-bottom: 20px;
padding-top: 0px;
align-items: center;
}
.table5 {
padding-bottom: 20px;
}
table {
border-collapse: collapse;
margin: 0 auto;
}
<div>
<div lang="en" dir="ltr" class="table1">
<table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" class="table2">
<tbody>
<tr>
<td class="table3">
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="table4">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="210">
<tbody>
<tr style="text-align: center;">
<td height="32" width="42">
<a href="" target="_blank" data-saferedirecturl="">
<img src="https://www.w3schools.com/images/picture.jpg" width="32" height="32">
</a>
</td>
<td height="32" width="42">
<a href="" target="_blank" data-saferedirecturl="">
<img src="https://www.w3schools.com/images/picture.jpg" width="32" height="32">
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="table5">
<a href="" target="_blank" data-saferedirecturl="">
<img src="" alt="" width="136" height="50">
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Add Table align:center
<div>
<div lang="en" class="table1">
<table align="center" role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" class="table2">
<tbody>
<tr>
<td class="table3">
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="table4">
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" width="210">
<tbody>
<tr>
<td height="32" width="42">
<a href="" target="_blank" data-saferedirecturl="">
<img src="" width="32" height="32" >
</a>
</td>
<td height="32" width="42">
<a href="" target="_blank" data-saferedirecturl="">
<img src="" width="32" height="32" >
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="table5" style="text-align:center">
<a href="" target="_blank" data-saferedirecturl="">
<img src="" alt="" width="136" height="50">
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
https://jsfiddle.net/lalji1051/f2gs7erq/5/

Validation Service - Unsuccessful validation for Email message

I'm trying to create an Email HTML template using XHTML document.
I was trying to test the document using "Markup Validation Service" but without success. I got 2 errors and I was trying to figure it out and did some changes but it doesn't fix.
This is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.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>Welcome</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato" />
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse; border: 1px solid #cccccc;">
<tr>
<td align="center" bgcolor="#70bbd9" style="padding: 2px 2px 2px 2px;">
<img src="img/coffee2.jpg" alt="Welcome to Cricket" width="600" height="400" style="display: block;" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" style="padding: 10px 30px 20px 30px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="padding: 10px 0 20px 0; font-family:lato; line-height: 140%;">
We're so happy!!!
<br/>
We founded this because we wanted to create a trustworthy app.
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="260" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<img src="img/testimonial-bg.jpg" alt="" width="100%" height="140" style="display: block;" />
</td>
</tr>
<tr>
<td style="padding: 10px 0 0 0; font-family:lato; line-height: 140%;">
<h4>Extension</h4>
<a href="http://www.google.com"><button style="margin:33px 0 0 15px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
font-size: 14px; background-color: Transparent;
background-repeat:no-repeat;
border: 1px solid black;
cursor:pointer;overflow: hidden;outline:none;">GET THE EXTENSION</button></a>
</td>
</tr>
</table>
</td>
<td style="font-size: 0; line-height: 0;" width="20">
</td>
<td width="260" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<img src="img/technology-1940695_1920.jpg" alt="" width="100%" height="140" style="display: block;" />
</td>
</tr>
<tr>
<td style="padding: 10px 0 0 0; font-family:lato;line-height: 140%;">
<h4>Application</h4>
<a href="http://www.google.com"><button style="margin:10px 0 0 50px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
font-size: 16px; background-color: Transparent;
background-repeat:no-repeat;
border: 1px solid black;
cursor:pointer;overflow: hidden;outline:none;">GET THE APP</button></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#363940" style="padding: 30px 30px 30px 30px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<td width="90%" style="font-family:lato; color:#ffffff;">
® Copyright © 2017 <br/>
</td>
<td align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="font-size: 0; line-height: 0;" width="20"> </td>
<td>
<a href="http://www.facebook.com/">
<img src="img/fb.gif" alt="Facebook" width="38" height="38" style="display: block;" border="0" />
</a>
</td>
</tr>
</table>
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
What am I missing ?
Thank you.
The Markup Validation Service says:
Line 84, Column 70: document type does not allow element "td" here;
assuming missing "tr" start-tag
A <td> must be inside of a <tr>.
<table>
<tr>
<td></td>
</tr>
</table>
This is the HTML.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.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>Welcome</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato" />
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse; border: 1px solid #cccccc;">
<tr>
<td align="center" bgcolor="#70bbd9" style="padding: 2px 2px 2px 2px;">
<img src="img/coffee2.jpg" alt="Welcome to Cricket" width="600" height="400" style="display: block;" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" style="padding: 10px 30px 20px 30px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="padding: 10px 0 20px 0; font-family:lato; line-height: 140%;">
We're so happy!!!
<br /> We founded this because we wanted to create a trustworthy app.
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="260" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<img src="img/testimonial-bg.jpg" alt="" width="100%" height="140" style="display: block;" />
</td>
</tr>
<tr>
<td style="padding: 10px 0 0 0; font-family:lato; line-height: 140%;">
<h4>Extension</h4>
<a href="http://www.google.com">
<button style="margin:33px 0 0 15px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
font-size: 14px; background-color: Transparent;
background-repeat:no-repeat;
border: 1px solid black;
cursor:pointer;overflow: hidden;outline:none;">
GET THE EXTENSION
</button>
</a>
</td>
</tr>
</table>
</td>
<td style="font-size: 0; line-height: 0;" width="20">
</td>
<td width="260" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<img src="img/technology-1940695_1920.jpg" alt="" width="100%" height="140" style="display: block;" />
</td>
</tr>
<tr>
<td style="padding: 10px 0 0 0; font-family:lato;line-height: 140%;">
<h4>Application</h4>
<a href="http://www.google.com">
<button style="margin:10px 0 0 50px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
font-size: 16px; background-color: Transparent;
background-repeat:no-repeat;
border: 1px solid black;
cursor:pointer;overflow: hidden;outline:none;">
GET THE APP
</button>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#363940" style="padding: 30px 30px 30px 30px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="90%" style="font-family:lato; color:#ffffff;">
® Copyright © 2017 <br />
</td>
<td align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="font-size: 0; line-height: 0;" width="20"> </td>
<td>
<a href="http://www.facebook.com/">
<img src="img/fb.gif" alt="Facebook" width="38" height="38" style="display: block;" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Responsive HTML in Email

I am trying to create a HTML Template which I will use to send emails.
In template, I have a single row table which I want to make it either completely horizontal or completely vertical like below depending on screen width.
in laptop or desktop it should look like this
and in mobile devices it should look like this
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important;}
.content {width: 100%; max-width: 600px;}
.subhead {font-size: 15px; color: #ffffff; font-family: sans-serif; letter-spacing: 10px;}
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
.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;}
</style>
<table>
<tr>
<td class="innerpadding borderbottom">
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
<table width="40" align="left" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" style="padding: 0 20px 20px 0;">
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</table>
</td>
</tr>
</table>
Have you tried using bootstrap? It would make your life very easier. And would involve less code.
sample :
table { width: 90%; }
td { height: 40px; padding: 0px 20px 20px 0px; border: 1px solid #333; }
#media screen and (max-width: 640px) {
td { display: block; width: 90%; }
}
<html>
</head>
<body>
<table>
<tbody>
<tr>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
<td>
<img src="http://png-1.findicons.com/files/icons/1580/devine_icons_part_2/128/mail_2.png" width="40" height="40" border="0" alt="" />
</td>
</tr>
</tbody>
</table>
</body>
</html>

How do i get rid of white space around image and table cells in HTML email

I have a pre-designed HTML email that i have sliced and coded using Komodo edit. All content is within a table where display: block and border-collapse: collapse; have been added to the tables inline-CSS and also line-height: 0px; to the cells inline-CSS. I have been using EmailonAcid to test my HTML email and what seems to be happening is everything looks fine on every email program except for Outlook. Outlook is addining extra white space to the sliced images causing the surrounding content/images to become out of line.
<table id="Table_01" style="border: 1px solid #D6D6D7; font-family: sans-serif; font-size: 14px; border-collapse: collapse;" width="800" height="1501" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_01.jpg" width="800" height="312" alt=""></td>
</tr>
<tr>
<td colspan="6" style="width: 800; height:199px; padding: 20px 10px 0px 15px;">
<p> ALL MY TEXT GOES HERE</p>
</td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_03.jpg" width="800" height="37" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img style="display: block;" src="images/edm_personalised_02_04.jpg" width="180" height="47" alt=""></td>
<td colspan="2" style="width: 135px; height: 47; font-size: 12px; text-transform: uppercase;">
Text here
<br/>
<span style="font-weight: bold;">£#XX.XX#</span>
</td>
<td colspan="2">
<img style="display: block;" src="images/edm_personalised_02_06.jpg" width="485" height="47" alt=""></td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_07.jpg" width="800" height="88" alt=""></td>
</tr>
<tr>
<td colspan="3" style="width: 228px; height: 21px; font-size: 12px; text-transform: uppercase; ">
text here
</td>
<td colspan="3">
<img style="display: block;" src="images/edm_personalised_02_09.jpg" width="572" height="21" alt=""></td>
</tr>
<tr>
<td style="width:" 90px; height: 21px; font-size: 12px;">
<span style="font-weight: bold;">
£#XX.XX#</span> </td>
<td colspan="5">
<img style="display: block;" src="images/edm_personalised_02_11.jpg" width="710" height="21" alt=""></td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_12.jpg" width="800" height="140" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img style="display: block;" src="images/edm_personalised_02_13.jpg" width="605" height="48" alt=""></td>
<td style="width: 195px; height: 48px; font-size: 12px;text-transform: uppercase;">
text here
<br/>
<span style="font-weight: bold; ">£#XX.XX#</span>
</td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_15.jpg" width="800" height="66" alt=""></td>
</tr>
<tr>
<td colspan="6" style="width: 800px; height: 145px; font-size: 24px; text-align: center;">
#dealername#
<br/>
#contact_number#</td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_17.jpg" width="800" height="329" alt=""></td>
</tr>
<tr>
<td colspan="6">
<img style="display: block;" src="images/edm_personalised_02_18.jpg" width="800" height="58" alt=""></td>
</tr>
<tr>
<td>
<img style="display: block;" src="images/spacer.gif" width="90" height="1" alt=""></td>
<td>
<img style="display: block;" src="images/spacer.gif" width="90" height="1" alt=""></td>
<td>
<img style="display: block;" src="images/spacer.gif" width="48" height="1" alt=""></td>
<td>
<img style="display: block;" src="images/spacer.gif" width="87" height="1" alt=""></td>
<td>
<img style="display: block;" src="images/spacer.gif" width="290" height="1" alt=""></td>
<td>
<img style="display: block;" src="images/spacer.gif" width="195" height="1" alt=""></td>
</tr>
Is there anyway of getting rid of the extra spaces?
Try style="line-height: 0px;" on table cells.
Also look carefully if widths and heights on table cells and images are correct and set properly.
The problem is that slicing full layout sometimes creates unnecessary white space for images, as that full layout slicing does not properly justify the trs and tds for the layout. I suggest you need to create a table in dreamweaver and slice only the images that you require and put them manually. This will solve your issue. I have done it practically and it works for me.

Is it possible to make DIV with inline-block to behave exactly like IMG with align=left?

In the following example making DIV inline-block turns off valign effect. Is it possible to bring it back as with IMG in next row?
<table border="1">
<tr>
<td height="50" valign="top">
<div style="display:inline-block; width:65px; height:40px; background-color: yellow; text-align: left;"></div>
<input type="button" value="button">
Some text
</td>
</tr>
<tr>
<td height="50" valign="top">
<img src="images/spacer.gif" width="65" height="40" align="left" border="1">
<input type="button" value="button">
Some text
</td>
</tr>
</table>
Add vertical-align: top; to your <div>.
<div style="display:inline-block; width:65px; height:40px; background-color: yellow; text-align: left;border: 1px solid black;vertical-align:top;"></div>
Demo: http://jsfiddle.net/ThinkingStiff/xvpYF/
HTML:
<table border="1">
<tr>
<td height="50" valign="top">
<div style="display:inline-block; width:65px; height:40px; background-color: yellow; text-align: left;border: 1px solid black;vertical-align:top;"></div>
<input type="button" value="button">
Some text
</td>
</tr>
<tr>
<td height="50" valign="top">
<img src="images/spacer.gif" width="65" height="40" align="left" border="1">
<input type="button" value="button">
Some text
</td>
</tr>
</table>
Output:
try putting it to float:left
http://jsfiddle.net/pixelass/XDNe6/
<table border="1">
<tr>
<td height="50" valign="top">
<div style="display:inline-block;float:left; width:65px; height:40px; background-color: yellow; text-align: left;"></div>
<input type="button" value="button">
Some text
</td>
</tr>
<tr>
<td height="50" valign="top">
<img src="images/spacer.gif" width="65" height="40" align="left" border="1">
<input type="button" value="button">
Some text
</td>
</tr>
</table>