Reputation: 10068
I'm new to CSS and I'm trying to learn the concept of font. I saw this code online, I understand by default 1em = 16px but I don't understand why 2.8em is divided by 1.2? What is the reason behind it or is it unnecessary?
h1 { font: 700 2.8em/1.2 "Droid Sans", sans-serif; }
Upvotes: 2
Views: 82
Reputation: 18546
That is the short-hand font
syntax for defining both font-size
and line-height
; specifically a font-size
of 2.8em
and a line-height
of 1.2
. You can consult the MDN on the font
CSS property for more details.
Upvotes: 4