I'm Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with HTML, CSS and SVG. To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

my books

Pro CSS3 Animation book coverPro CSS3 Animation, Apress, 2013

my other blogs

Massive Head CanonMassive Head Canon: Intelligent discussion of movies, books, games, and technology.

my projects

The New DefaultsThe New Defaults — A Sass color keyword system for designers.

CSSslidyCSSslidy — an auto-generated #RWD image slider. 3.8K of JS, no JQuery.

Create Brushed Metal Lettering With CSS Gradients

Glossy text editable in your HTML.

Yesterday one of my 2nd year web development students presented a site mockup featuring gradients inside heading text. She was under the impression that creating this effect meant that all the text would have to be rendered out as bitmap images before it could be used on a site, which obviously adds to file size and page download time while lowering accessibility and SEO.

That’s not entirely true: you can create a brushed metal effect by creating a gradient in CSS, and applying it inside text: the one drawback is the gardient is only currently visible in Webkit browsers. For this example, I’ll use the Origin font by Nathan Towie:

The result is what you see at the top of this article. This is one of the areas where vendor prefixed CSS really works well: the gradient is only produced for Chrome and Safari, and they are the only browsers to place the brushed metal effect inside the text. Every other browser sees the same text, but in a single color.

I've shown a way of achieving this effect cross-browser previously, but that technique works by embedding the text inside an SVG document, which reduces compatibility with older browsers (read: IE8 and earlier).

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.