Skip to main content

Hello Everyone,

I understand this is repeated question and there are many community questions & blogs related to this and I tried everything (from fixed-text to data-ogsc), but nothing seems to work. I need the community’s help now.

I’m using a background image and trying to put white text on it. Here is a one of the sample code I tried but didn’t work.

 

<!-- Background Image Table -->
<table width="100%" background="https://bydrvali.com/media/email/email-bg.jpg" style="background: url('https://bydrvali.com/media/email/email-bg.jpg'); background-repeat: no-repeat; background-size: cover; background-position: center;">
  <tr>
    <td align="center" style="padding: 80px 20px;">
      <!-- White Text with inline styling -->
      <p style="font-size: 24px; margin: 0; color: #FFFFFF !important; line-height: 1.3; mso-line-height-rule: exactly;">
      Hello, this is a Test!
      </p>
    </td>
  </tr>
</table>

 

If anyone could help me put white text on this background while showing up correctly on the Gmail App that would be greatly appreciated.

 

Thanks!

The Gmail app on iOS often overrides inline text colors in dark mode, even when color: #FFFFFF !important is used. To help prevent this, wrap your white text in a <span> inside a <div> and use both inline styles and the data-ogsc attribute like so: <span style="color: #ffffff !important;" data-ogsc="color: #ffffff;">Text</span>. This improves compatibility but isn’t foolproof, as Gmail may still darken content based on its own logic. For guaranteed results, consider using text as an image, though that affects accessibility.


Hi ​@emily123,

 

Unfortunately, as ​@Rohit045 stated, there’s no foolproof solution here that uses live text. The good news is that using text as an image is an almost perfect workaround!

 

I highly recommend making the text a PNG file with transparent background, and overlaying it in front of the background image. That’s a foolproof way to ensure the text shows up as white in front of your background image. And if you use alt text then it will satisfy accessibility needs, as well.

 

Here’s an example with your background image in place. In it, I’m using spacers above and below. But to maximize clickability, I’d actually recommend using transparent spacer PNGs.

 

I hope this helps.

 

Cheers!

Paul


Thank you so much for your responses guys, I was able to work with text as images as ​@Paul808 suggested. I really appreciate your answers. Have a great day!!