Cross-browser, W3C validated and graphic-free technique for creating gradients
I've found a way to create horizontal or vertical gradients, that works cross-browser, validates W3C, and involves no image.
The technique is only able to work until very recently... it takes advantage of the fact that almost all non-IE browsers now support SVG, and uses IE conditional statements to hide the SVG from IE and instead uses the DXTransform object for IE (which doesn't support SVG). The reason this validates is because the IE conditional statements, and DXTransform code, are seen as comments.
Admittedly, it is a hack. But it works like a charm on Firefox 1.5+, Opera, Safari, and IE.
I've implemented this technique in a website already:
Feel free to use it for yourself!
Last edited by WebJoel; 12-02-2007 at 06:50 PM.