Project Me
Project Me

« The Finn Brothers || current || Server Error: Google IPO worth up to $3.3B »

CSS Font Shorthand

If you ever get a “too few values for the property” error after validating shorthand font declarations, remember to specify the font-family if you specify the font-size.

wrong:

p { font: bold 11px/15px; }

right:

p { font: bold 11px/15px arial; }

Of course, if you spend your days hanging out at the W3C, you’ve probably already read the spec on font and understand that’s what the question marks indicate in the following:

[ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

Glad we have that all cleared up.

July 19, 2004