...

View Full Version : Explanation for css font:



cc4digital
06-05-2010, 04:41 AM
Today, I saw some code that was a bit different than I am used to seeing. Hope someone can explain the /1?

The code was:
font: 80%/1 arial, helvetica, sans-serif;

I understand the font types, but what has me stumped is why the /1? Why not just set it to 80%?

Just thought someone might have an idea.:confused:

Apostropartheid
06-05-2010, 05:28 AM
The /1 designates the line-height (leading). Leading is typically something around 1.5 by default.

For example, font: 0.75em/1.6 serif; would give me a line-height of 1.6.

optimus203
06-05-2010, 04:16 PM
And does that shorthand work across all browsers? First time I've seen that too.

coothead
06-05-2010, 05:20 PM
Hi there cc4digital,

the full font shorthand is...

font: [font-style] [font-variant] [font-weight] [font-size/line-height ] [font-family ]

Further reading:-
http://www.w3.org/TR/CSS2/fonts.html#propdef-font
coothead

Apostropartheid
06-05-2010, 05:42 PM
Font shorthand works in any browser that vaguely matters.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum