Today we'll cover the CSS Shorthand for font. (I know, this is pretty straightforward stuff. I'm just busy, yet still want to post something that might help someone. This is easy.)
Okay, the following is from the W3C Spec:
font: font-style | font-variant | font-weight | font-size/line-height | font-family | caption | icon | menu | message-box | small-caption | status-bar | inherit
Now this is from CSS 2. And I have not messed around with caption | icon | menu | message-box | small-caption | status-bar. And as stated above, I'm fairly busy today. So we're going to skip that.
All of the following examples are valid:
p { font: 11px/1.2em sans-serif }
p { font: 80% sans-serif }
p { font: x-large/110% "New Century Schoolbook", serif }
p { font: bold italic large Palatino, serif }
p { font: normal small-caps 120%/120% fantasy }
A little confusing? Not really. Just remember that the first three rules (font-style, font-variant, font-weight) are set to normal if not mentioned. Any value not explicitly given a value is reset. (Normal, inherited value, whatever.)
See? Pretty straightforward. Style, Variant, Weight, Size/Hight, Family.
SVWSHF
"So Very Willing to SHoot Fish"?
"Steve Vascik Wants to SHine Fenders"? (sorry Steve) You can make your own.
Comments are Open (0)
Posted at 10:02 AM