Propiedad de fuente CSS
La propiedad de fuente CSS
Para acortar el código, también es posible especificar todas las propiedades de fuente individuales en una propiedad.
La font
propiedad es una propiedad abreviada para:
font-style
font-variant
font-weight
font-size/line-height
font-family
Nota: Los
valores font-size
y son obligatorios. font-family
Si falta uno de los otros valores, se utiliza su valor predeterminado.
Ejemplo
Úselo font
para establecer varias propiedades de fuente en una declaración:
p.a
{
font: 20px Arial, sans-serif;
}
p.b
{
font: italic small-caps bold 12px/30px Georgia, serif;
}
Todas las propiedades de fuentes CSS
Property | Description |
---|---|
font | Sets all the font properties in one declaration |
font-family | Specifies the font family for text |
font-size | Specifies the font size of text |
font-style | Specifies the font style for text |
font-variant | Specifies whether or not a text should be displayed in a small-caps font |
font-weight | Specifies the weight of a font |