font shorthand property sets all font properties in one declaration.
The order is: font-style, font-variant, font-weight, font-size/line-height, font-family
Among them: the values of font-size and font-family are required. If other values are missing, default values will be inserted, if any.
Example:
span {
font: italic bold 12px< /span>/30px Georgia, serif;
}
font-style
Set font style
Parameters:
normal
default value, browser display
italic
Italic
oblique
oblique
inherit
inherits the font style of the parent element
span {
font-style: italic;
}
font-variant
lowercase to uppercase
Parameters:
normal
default value
small-caps
lowercase to uppercase
inherit
inherits the parent element
font-weight
font weight
Parameters:
normal
default
bold
bold
bolder
is bolder
lighter
100 - 900 where 400 is equal to normal and 700 is equal to bold
inherit
inherits the parent element
font-size
font size
font-family
Define the font of an element
Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/fonts%20in%20CSS.html
评论列表(196条)
测试