Font in CSS | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Font in CSS

p { font-weight: bold; font-size: 14pt; font-family: Georgia, serif; } ā€¢ How can I rewrite this code in one line ?

1st Aug 2020, 10:29 AM
Noud Al Mansouri
Noud Al Mansouri - avatar
2 Respostas
+ 14
https://www.w3schools.com/css/css_font_shorthand.asp so following by the examples on the link: p { font: bold 14pt Georgia, serif; }
1st Aug 2020, 10:31 AM
Burey
Burey - avatar
0
ā€¢ CSS shorten code method: To shorten the code, it is also possible to specify all the individual font properties in one property. TheĀ fontĀ property is a shorthand property for: font-style font-variant font-weight font-size/line-height font-family ā€¢ Example: Set some font properties with the shorthand declaration: p.aĀ { Ā  font:Ā 20px Arial, sans-serif; } p.bĀ { Ā  font:Ā italic small-caps bold 12px/30px Georgia, serif; } ā€¢ Your code will seem like that: p { font: bold 14pt Georgia, serif; }
4th Aug 2020, 3:16 AM
Bits!