7

Possible Duplicate:
What does this CSS shorthand font syntax mean?

I saw many people doing that:

body {
font: bold 12px/13px Arial, Helvetica, sans-serif;
}

What is this 12px/13px for?

Community
  • 1
  • 1
pedrozath
  • 2,353
  • 4
  • 20
  • 23

3 Answers3

15

12px is the font size and 13px the line height.

Example of declaring all font properties in a one liner here.


All this being said, I'll just add that this is a pretty unusual way of writing it and I wouldn't recommend it since it might confuse most developers.

marcgg
  • 65,020
  • 52
  • 178
  • 231
2

The 12px is the height of the font in pixels. The 13px is the height of the line in pixels.

Mike Chess
  • 2,758
  • 5
  • 29
  • 37
2

You might see something like

body { font:13px/1.231 sans-serif; *font-size:small; }

Notice there is no "px" after 1.231 and the line height in this case will be 123.1% of the text size. This is used to unify native line-heights that might otherwise be larger or smaller that you'd want them.

eddie.vlagea
  • 667
  • 1
  • 6
  • 18