Reputation: 2858
I'm looking for a way to get a color gradient within a cell in a table. I found a couple examples examples online that involve CSS or Javascript, but trying to stay away from those.
For example, I found this:
<table style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');">
The `Mircorosft" scares a bit for compatibility. This is for email marketing, so it needs to be as simple as possible because email clients are rather limitted in rendering html. Any suggestions?
Upvotes: 1
Views: 102
Reputation: 6432
No, there is no universal solution that will work on email clients. Your best bet is to use a pregenerated background image but now days most clients block images by default
Upvotes: 0
Reputation: 47667
Email clients are the worst in terms of rendering your HTML and CSS, so try to be as minimalistic as you can. The CSS gradients won't work in 90% of clients, so avoid it.
The best solution probably to put a solid background color (so it will be shown before the images are loaded, if loaded) and add a background image.
Upvotes: 1
Reputation: 4254
I would put background pictures. This will make sure email client will show it.
Upvotes: 0
Reputation: 82209
Check out CSS3 gradients. There are lots of generators on the web to try out, such as this one. http://gradients.glrzad.com/
In terms of browser compatibility, this table will show you the way:
http://caniuse.com/#feat=css-gradients
Upvotes: 0