Font shorthand in CSS

A little back to basics but useful nonetheless…

If you’re writing this:

font-weight:bold;
font-style:italic;
font-variant:caps;
font-size:1em;
line-height:1.5em;
font-family:arial,sans-serif

…you’re missing out on the shorthand:

font: bold italic small-caps 1em/1.5em arial,sans-serif

Just remember that you must always state both font size and family each time you write it and family must be at the end. Style, variant and size will always default to normal.