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.







