![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Occasionally, I've seen people write CSS code in shorthand for specifying font styles. I don't exactly remember how it goes |
|
SPAN {font: arial, helvetica 11 bold}... |
|
I think this is a great idea |
#3
| |||
| |||
|
|
Occasionally, I've seen people write CSS code in shorthand for specifying font styles. I don't exactly remember how it goes, but sometimes I see things like this: SPAN {font: arial, helvetica 11 bold}... I think this is a great idea, and I'd like to do some fine tuning of my own code. Does anybody know where I can get an explanation of how this coding strategy works? What about for multiple font names? Any information is appreciated. Thanks! |
#4
| |||
| |||
|
|
On Sun, 22 Aug 2004 11:40:22 -0500, Dave <dave (AT) yahoo (DOT) com> wrote: Occasionally, I've seen people write CSS code in shorthand for specifying font styles. I don't exactly remember how it goes, but sometimes I see things like this: SPAN {font: arial, helvetica 11 bold}... I think this is a great idea, and I'd like to do some fine tuning of my own code. Does anybody know where I can get an explanation of how this coding strategy works? What about for multiple font names? Any information is appreciated. Thanks! See http://www.w3.org/TR/CSS2/propidx.html for all CSS2 properties. You'll find a number of shorthand possibilities, including font. However, your above rule is flawed. Font-family comes last, and 11 has no unit. It's not required, but advisable, to end your font family with a generic. span {font: bold 110% Arial, Helvetica, sans-serif} Is it better? If you use the font shorthand all 5 the font-weight, font-style, font-size and font-family are reset to their normal values before the changes you make are set. So if you don't state all of these values, you might expect a font-weight: bold to be inherited but it won't be. Like all shorthand styles, there are times it's the right tool for the job, and times it's not. |
#5
| |||
| |||
|
|
Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes? |
#6
| |||
| |||
|
|
Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes? |
#7
| |||
| |||
|
|
Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes? |
#8
| |||
| |||
|
|
Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes? |
![]() |
| Thread Tools | |
| Display Modes | |
| |