Article View: alt.comp.software.thunderbird
Article #411Re: How do I stop background image repeating
From: Paul
Date: Tue, 24 Nov 2026 05:15
Date: Tue, 24 Nov 2026 05:15
150 lines
5879 bytes
5879 bytes
On Mon, 11/23/2026 11:01 PM, T wrote:
> On 11/23/26 17:38, dillinger wrote:
>> Instead of file:///home/temp/confetti2.png, you can also use an image
>> located somewhere on the internet (e.g.,https://my.site/confetti2.png).
>
> When I sent the test to me, it could not find the file on
> my local drive. So, putting a public url would not help.
>
> And I did check the source on the email that did come back.
> It was verbatim of what I sent.
>
> file:///home/temp/confetti2.png exists on my drive.
Can you get the AI to write one of these for you ?
It must know the right tricks.
This is too hard for me :-) Help, help, Ai, save us.
OK, here we go on a roller coaster ride.
******* CoPilot Question *******
If you were writing an HTML email with a non-repeating BASE64 embedded
background image in it, what code would you use (style, body, and so on) ?
The code should survive transmission through gmail (which apparently
can modify HTML email).
******* CoPilot Answer ********
If your requirement is specifically:
"HTML email + non-repeating background image + Gmail-compatible + survives
transmission through Gmail"
then the first thing to know is that Base64 (data:image/...;base64,...)
background images are not a good choice. Gmail's sanitization commonly strips
or blocks data URIs in email HTML, and support across mail clients is poor.
Gmail webmail in particular does not reliably render Base64-embedded images.
For maximum compatibility, email developers typically:
Host the image on HTTPS.
Use a table-based layout.
Apply the background image to a <td> via inline CSS.
Specify background-repeat:no-repeat.
Include a solid fallback background-color.
A Gmail-friendly pattern looks like:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Email</title>
</head>
<body style="margin:0;padding:0;">
<table
role="presentation"
cellpadding="0"
cellspacing="0"
border="0"
width="100%">
<tr>
<td
align="center"
bgcolor="#ffffff"
background="https://example.com/background.jpg"
style="
background-image:url('https://example.com/background.jpg');
background-repeat:no-repeat;
background-position:center top;
background-size:cover;
margin:0;
padding:0;
">
<table
role="presentation"
cellpadding="0"
cellspacing="0"
border="0"
width="600">
<tr>
<td style="padding:40px;">
<h1 style="margin:0;font-family:Arial,sans-serif;">
Hello
</h1>
<p style="font-family:Arial,sans-serif;">
Email content here.
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
If you absolutely insist on Base64, the syntax would be:
<td style="
background-image:url(data:image/png;base64,iVBORw0KGgoAAA...);
background-repeat:no-repeat;
background-position:center top;
">
but you should expect Gmail to remove or ignore it.
For modern Gmail, a more robust approach is:
<td
background="https://example.com/bg.png"
style="
background:url('https://example.com/bg.png') no-repeat center top;
background-size:100% auto;
">
A few additional email-specific notes:
Put CSS inline rather than in <style> blocks whenever possible.
Use tables, not flexbox/grid.
Do not rely on CSS classes surviving; Gmail may rewrite HTML.
Keep the entire message under Gmail's clipping threshold (~102 KB of HTML)
because large Base64 strings can cause clipping. If the image must travel
with the message and not be fetched remotely, use a MIME CID attachment
(src="cid:...") rather than Base64 in the HTML. CID images generally
survive Gmail and Outlook much better.
So the practical answer is: there is no Base64 background-image solution
that can be recommended as Gmail-safe. If Gmail compatibility matters,
use a hosted HTTPS image (best) or a CID-attached image.
If you ever need to support Outlook desktop (Windows) as well, there is a
whole additional layer involving VML (<v:rect> and <v:fill>) background-image
fallbacks. The resulting code is admittedly ugly, but it's the closest
thing to a "works everywhere" solution for email backgrounds.
******* End: CoPilot Answer *******
Paul
Technical Details
Message-ID:
<11e36hf$2hcv7$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11dvr4p$1cl6b$1@dont-email.me> <ada088b0-2c9e-4f4d-ba57-f0b5775249b4@news.betterbird.eu> <11dvusv$1dr65$1@dont-email.me> <11e009u$1ec44$1@dont-email.me> <3gjctm-hml1.ln1@spock.lan> <11e2n11$2cviq$1@dont-email.me> <6l5ftm-lpu.ln1@spock.lan> <9d6ftm-0gv.ln1@spock.lan> <11e3260$2g41p$2@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul <nospam@needed.invalid> Newsgroups: alt.comp.software.thunderbird Subject: Re: How do I stop background image repeating Date: Tue, 24 Nov 2026 00:15:27 -0500 Organization: A noiseless patient Spider Lines: 150 Message-ID: <11e36hf$2hcv7$1@dont-email.me> References: <11dvr4p$1cl6b$1@dont-email.me> <ada088b0-2c9e-4f4d-ba57-f0b5775249b4@news.betterbird.eu> <11dvusv$1dr65$1@dont-email.me> <11e009u$1ec44$1@dont-email.me> <3gjctm-hml1.ln1@spock.lan> <11e2n11$2cviq$1@dont-email.me> <6l5ftm-lpu.ln1@spock.lan> <9d6ftm-0gv.ln1@spock.lan> <11e3260$2g41p$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 24 Nov 2026 05:15:28 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2667495"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mrWC9morn0QUwTteEZ/rk7YQg3tLUHuM="; posting-host="1a1aef0cb0715fbd9293be2a51d7f61a" User-Agent: THIS SPACE FOR RENT Cancel-Lock: sha1:XvmJFoZJ25VVpYPXtq6u3qLm/N4= sha256:vO4LfLacFhq2ualiqVlYIA8/hooK8jdmANCu+yENHPI= sha1:BpUZwzBla6zCd1N/fUXsQawqi4k= sha256:jwD0KAJ1j8k7jbr/B9EvG3jWxJOAC9YvLKUo8pDAv9A= In-Reply-To: <11e3260$2g41p$2@dont-email.me> Content-Language: en-US