Typography - Getting The Hang Of Typography

(lu) #1
1 .post h 2 {

(^2) font-weight: bold;
(^3) color: red;
4 }
This is just a quick reminder that there is no need to add classes to
everything you want to style with CSS, especially text. Think simple.


The Font Property


Instead of specifying each property separately, you can do it all in one go
using the font shorthand property. The order of the properties should be as
follows: font-style, font-variant, font-weight, font-size,
line-height, font-family.


When using the font shorthand, any values not specified will be replaced
by their parent value. For example, if you define only 12px Helvetica,
Arial, sans-serif, then the values for font-style, font-variant
and font-weight will be set as normal.


The font property can also be used to specify system fonts: caption,
icon, menu, message-box, small-caption, status-bar. These values
will be based on the system in use, and so will vary according to the user՚s
preferences.


Other Font Properties


A few font-related properties and values are not as commonly used. For
example, instead of using text-transform to turn your text into all caps,
you could use font-variant: small-caps for a more elegant effect.

Free download pdf