Someday, all the nifty Photoshop Blending options will be available as CSS properties. Mark my words! In the mean time, we’re kind of stuck with drop shadows, and now gradients (and text strokes) for WebKit browsers. Too bad you can’t use them together.
In order to take advantage of the background clipping, the color needs to be transparent. First off, that pretty much ruins any other browser from displaying text. So this is only useful to Safari users (not even the iPhone currently supports it). In Photoshop, you can get around having a transparent color and still having a drop shadow by setting that layers Fill Opacity to 0% while the layers opacity at 100%.
Also, using this technique has some odd behavior with padding. In my example, I couldn’t set padding to the parent div without the effect inheriting that padding. Restating the padding didn’t affect it either.
Here is the example: webkit-background-clip.html
Now, you can add the -webkit-text-stroke and that will work with text-shadow, but only on the stroke and not the text. I’ve yet to find an example that uses all three without looking like one of Superjail’s Doctor’s genetic experiments.
Perhaps it is for the best, getting these to work together might have been the next blink.
Pingback: Fun with WebKit css gradients | Martini Lab Blog