font: [font-style] [font-variant] [font-weight] [font-size/line-height] [font-family];
|
p {
font-weight: bold; font-size: 20px; font-family: Arial, sans-serif; } |
p {
font: bold 20px Arial, sans-serif; } |
Note -
That since font-style, font-variant, font-weight and line-height are optional, the three of them are skipped in this example. It is important to note that using the shortcut resets the other attributes not given. Another important point is that the two necessary attributes for the font shortcut to work are font-size and fontfamily. If they are not both included the shortcut is ignored. |