What does the slash mean here: "font-size: 100%/120%"?
+15
A:
This actually sets two properties and is equivalent to:
font-size: 100%;
line-height: 120%;
Don't ask me why this particular shortcut exists, though.
Konrad Rudolph
2009-03-31 16:01:38
It's to mirror old typesetting syntax, where you'd have font set as, for instance "10pt on 12pt", or "10pt/12pt".
David M
2009-03-31 16:06:28
+1 to correct answer and a meta +1 to history lesson :)
Darko Z
2009-03-31 18:31:54
+4
A:
Konrad got this one, but there are a lot of CSS shorthand properties like this that you can use to shorten your style sheets. Some of them look a little cryptic if you're not aware of them.
Bill the Lizard
2009-03-31 16:06:35
Most shorthands address related style properties, though (e.g. `border-*`). David has given a good explanation in the comments to my answer. As to shorthands being cryptic: certainly true, but so damn useful and quite easy to learn.
Konrad Rudolph
2009-04-01 08:37:29