skip to content rich footer

stevenclark.com.au

subscibe to the StevenClark.com.au rss feed

Font Family as a Last Alternative

There always seems to be someone out there needing an answer to this simple error from the Cascading Stylesheets (CSS) Validator: you are encouraged to offer a generic family as a last alternative.

This one is an easy fix. Basically you’re being told that your list of font-family: Verdana, Arial, Helvetica; should have a generic font family tacked on at the end in case none of the others are available.

font-family: Verdana, Arial, Helvetica, Sans-Serif;

The Fonts page at W3.org is well worth a read if you’re in any doubt about the five generic font families. They are Serif, Sans-Serif, Cursive, Fantasy and Monospace.

A word of caution comes along with this if you’re considering just dumping the generic font-family in there alone and hoping that every user agent will be ever so in love with your simple magnificence. Nope. Don’t be surprised if there’s a browser out there that chokes if you supply only the generic family on its own. Although I can’t recall off-hand which browser it was that choked.

I hope this simple tip helps get you over the line if you’re searching for this answer. I posted it on a previous blog and the constant traffic to the page far outstripped any other article I wrote in that year. Why? Because its simply something people are always looking for.

Articles are licenced under a Creative Commons Licence but copyright of images is retained by © Steven Clark 2007 - 2008

Comments are closed.

skip to top of page

Currently Reading

Andy Clarke's Transcending CSS: the fine art of web design has been sitting on my bookshelf for several months and I've finally made the time to read it from end to end. My favourite thing about this book from the outset is that it's a designer's book, rather than a technician's manual, for web designers. The artwork and direction in Transcending CSS is enhanced by the attention to detail in the feel and texture of the book itself, the size of it's pages and the feel of the cover in your hands. It's definately a book that affords the act of being read. Looking forward to it.