CSS font properties

Font properties

To shorten the code, you can also specify all individual font properties in one attribute.

font The property is a shorthand for the following properties:

  • font-style
  • font-variant
  • font-weight
  • font-size/line-height
  • font-family

Example

Use shorthand declarations to set some font properties:

p.a {
  font: 20px Arial, sans-serif;
}
p.b {
  font: italic small-caps bold 12px/30px Georgia, serif;
}

Try it yourself

Note:font-size and font-family The value is required. If one of the other values is missing, the default value will be used.

Alle CSS lettertype-eigenschappen

Eigenschap Beschrijving
font Korte eigenschap. Stel alle lettertype-eigenschappen in één verklaring in.
font-family Bepaal het lettertype van de tekst (lettertypefamilie).
font-size Bepaal de grootte van het lettertype van de tekst.
font-style Bepaal de stijl van het lettertype van de tekst.
font-variant Bepaal of tekst wordt weergegeven in een kleine kapitaallettertype.
font-weight Bepaal de dikte van het lettertype.