I am facing a weird problem with Italic font in HTML newsletters when I open them in Gmail.
I am using font-weight: 500; for the whole Headline, but when I try to Italicize a part of Headline then the font-weight goes normal for the text which is Italicized.
I am sharing the screenshot below to better understand the issue:
In the above screenshot taken from Gmail, font-weight:500 is set to whole headline. But when I try to Italicize the "October" then the font goes normal for that particular section.
here is the HTML:
<table role="presentation" class="wrap" width="570" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="hl-2">3. The month <i>October</i> is the best time to visit Jaipur.</td>
</tr>
</table>
here is the Css:
.hl-2 {
font-size: 18px;
line-height: 22px;
color: #34444c;
font-weight: 500;
}
Any idea how to handle this situation? Your help would be really appreciated.
Thanks!


TL;DR: Use
font-weight: boldinstead offont-weight: 500.The issue here is whether your font (Roboto) loaded properly and completely. Different fonts render boldness and italics differently. When it comes to email, remote resources aren't guaranteed to load. Your Gmail session isn't rendering this text in a font that supports medium weight italics; it's either a lighter version of Roboto (without weights) or else a different font altogether.
The MDN docs for
font-weightnote thatnormalis 400 andboldis 700, leaving 500 somewhere in the middle. There's a little more detail in the variable fonts section:If no custom weights are given for a font, your software will create them itself, rendering its own italics and bold (weight: 600, at least for me on Firefox on Debian) but no degrees of boldness, so weights of 600 or higher are bold while lower weights are normal.
In this example, I've pulled
font-familyandfont-weightout into their own classes so you can see the differences between Roboto loaded without and then with weights. I've also adjusted the white space and wrapping to minimize scrollbars.I was not able to reproduce your issue of losing boldness just for the italicized text (perhaps a browser or OS difference), but I still believe I've diagnosed and reproduced your issue correctly.
Since this is email, you can't be assured that remote resources will be loaded and you don't want to attach a font to the email. Expect most of your non-Gmail readers will see this in other fonts.
For broader support, I suggest using
font-weight: bold. If you want something lighter, consider something liketext-shadow: -0.02ex 0 currentColor, 0.02ex 0 currentColor;instead of a font weight (see this answer).