Home > Article > Web Front-end > What is font in css style
In CSS, font is an abbreviated attribute used to declare all font attributes; this attribute can specify font style, variant, thickness, size and line height, and font series in order. Unset attributes will Using its default value, the syntax is "element {font: font style specified in order;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
font shorthand property sets all font properties in one declaration.
This attribute also has a sixth value: "line-height", which can set the line spacing.
Description
This shorthand property is used to set two or more aspects of an element's font at once. Use keywords such as icon to appropriately set the font of an element to match an aspect of the user's computer environment. Note that if these keywords are not used, at least the font size and font family must be specified.
You can set the following properties in order:
font-style
The example is as follows:
<html> <head> <style type="text/css"> p.ex1 { font:italic arial,sans-serif; } p.ex2 { font:italic bold 12px/30px arial,sans-serif; } </style> </head> <body> <p class="ex1">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p> <p class="ex2">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p> </body> </html>
##(Learning video sharing: css video tutorial
)The above is the detailed content of What is font in css style. For more information, please follow other related articles on the PHP Chinese website!