Para reduzir o código, também é possível especificar todas as propriedades de fonte individuais em uma propriedade.
A fontpropriedade é uma propriedade abreviada para:
font-style
font-variant
font-weight
font-size/line-height
font-family
Exemplo
Defina algumas propriedades de fonte com a declaração abreviada:
p.a {
font: 20px Arial, sans-serif;
}
p.b {
font: italic small-caps bold 12px/30px Georgia, serif;
}
<!DOCTYPE html>
<html>
<head>
<style>
p.a {
font: 20px Arial, sans-serif;
}
p.b {
font: italic bold 12px/30px Georgia, serif;
}
</style>
</head>
<body>
<h1>The font Property</h1>
<p class="a">This is a paragraph. The font size is set to 20 pixels, and the font family is Arial.</p>
<p class="b">This is a paragraph. The font is set to italic and bold, the font size is set to 12 pixels, the line height is set to 30 pixels, and the font family is Georgia.</p>
</body>
</html>
<< Anterior Fontes CSS – Fontes do Google
Deixe um comentário