tags:

views:

297

answers:

4

I have this piece of code:

<table style="background-image: url(path/to_image.png)"> 

And when I load it in CKEditor it's transformed in:

<table style="background-image: url(&quot;path/to_image.png&quot;)">

Is this still still valid CSS? Actually I'm not so interested if it's valid but if there would be any problems with any web browser or email client ( the editor is used for composing a html email ). Firefox and Thunderbird seem to be fine with it.

+1  A: 

Yes, of course it is. Attribute values don't stop being attribute values just because they contain CSS or a URL. Entities still work (and are required if the character would otherwise have special meaning).

David Dorward
+1  A: 

It's very valid (Actually, this is probably the only valid way to do it! Got to keep this in mind.), but I would still test it in major E-Mail clients just to make sure. As we all know, HTML support in E-Mails is abysmal.

Pekka
A: 

It's valid, and required by the HTML standard, but it's unlikely to work in Outlook Express.

SLaks
A: 

Anyway, using background-image: url() won't work in an email with Thunderbird. Unless they have fixed it, Thunderbird didn't show background images.

And in the rest of mail clients, the user will get a warning because the mail is trying to load external files.

AlfonsoML
Actually it works with thunderbird, the code was just an example anyway. The warnings are something you can't really control, but that doesn't mean you should stop sending beautifully designed messages.
Mihai Secasiu
Yes, you can control the warnings. If you put the images inline the user will see the nice design without any warnings. Ops, I see that the Thunderbird bug happens just in THAT case, well, we can't have everything :)
AlfonsoML
For some reason no one who's sending large amounts of messages ( ESPs ) does it. I guess it takes too much resources to send like that. Also not sending images inline helps with tracking opens. If people get an email and they see all the images ( except for the tracking image, which they don't see anyway) they will ignore the warning so the tracking image will not load anymore.
Mihai Secasiu