I am trying to send a html email to my app clients. I have designed the following styled code, which work fine in my browser. But, for some reasons, some of the styles are ignored by Gmail.
I have commented some of them that seems to be ignored, all of them margins and paddings.
Why is that? How can I solve this issue?
PD: I am testing on safari browser, and Gmail app on iOS.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
*,
body {
margin: 0;
padding: 0;
}
body {
padding: 10px; /* IGNORED */
}
h2 {
font-family: "Arial", "Arial Bold", Gadget, sans-serif;
font-size: 20px;
font-style: normal;
font-variant: normal;
font-weight: 700;
line-height: 26.4px;
}
p,
a {
font-family: "Arial", sans-serif;
font-size: 14px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
a {
color: slategray;
text-decoration: none;
}
hr {
height: 1px;
margin: 10px 0px; /* IGNORED */
border: none;
background-color: silver;
}
header {
border-bottom: 1px solid silver;
padding: 10px; /* IGNORED */
}
main {
padding: 20px; /* IGNORED */
}
footer {
border-top: 1px solid silver;
padding: 10px; /* IGNORED */
}
footer p {
font-size: 11px;
margin: 3px 0px;
color: silver;
}
footer a {
font-size: 11px;
}
</style>
</head>
<body bgcolor="white">
<header>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/The_Boring_Company_Logo.svg/1024px-The_Boring_Company_Logo.svg.png"
height="50px"
alt="TBC"
/>
</header>
<main>
<h2>Hi, Emma</h2>
<br />
<p>We welcome you to our platform, ...</p>
<br />
<p>
Are you ready to start a new path in your life with our service? ...
</p>
<br />
<br />
<p>All the best,</p>
<p>The Boring Company.</p>
</main>
<footer>
<p>Please do not reply to this email. ...</p>
<p><a href="#">OC</a> | © All rights reserved</p>
</footer>
</body>
</html>