I made an image in Photoshop for an email newsletter, I linked them and also host all the images. But when I paste them in gmail there is a spacing between them. How do I remove the spacing? Here are the codes.
https://s10.gifyu.com/images/image7af8bf1d86020f60.png
<!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>
<title>Youtube Logo BW</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body bgcolor="#FFFFFF">
<!-- Save for Web Slices (Youtube Logo BW.png) -->
<table id="Table_01" width="1428" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="https://youtube.com">
<img id="Youtubex20Logox20BW_01" src="https://s10.gifyu.com/images/Youtube-Logo-BW_01.png" width="1428" height="666" border="0" alt="" /></a></td>
</tr>
<tr>
<td>
<a href="https://youtube.com">
<img id="youtube" src="https://s10.gifyu.com/images/youtubec5155edec989e9ff.png" width="1428" height="499" border="0" alt="" /></a></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>
3
Answers
https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/
this link will help you in detail.
But I think you should use style attribute for inline css. you can’t write directly bg-color etc in tags. instead use:
And then see what you get because I hope it will solve your problem. If your problem still remain then add a snapshot of that problem because I did’nt get exactly what you are asking for. and also try to use css units for width and height to get better results.
This is basically due to the HTML5 doctype. When you send an email, most email clients (especially webmails) will only include content from inside the
<body>
of your HTML. This means your doctype is ignored and instead the doctype from the webmail applies. Most webmails (like Gmail desktop webmail, Outlook.com or Yahoo’s desktop webmail) use an HTML5 doctype nowadays.And the HTML5 doctype has an unexpected side effect on images that now have a spacing below them. You can see this in your code localy simply by changing the doctype to an HTML5 doctype.
There are three different ways you fix this:
vertical-align:middle
in an inline style on the<img>
element.display:block
in an inline style on the<img>
element.font-size:0
to the parent element of the<img>
.I’d recommend using the first solution, which would give the following code:
If you want to learn more about this, here are two ressources I wrote that can interest you: