##Specify the font of the paragraph:
p { font-family:"Times New Roman",Georgia,Serif; }
Attribute definition and usage instructions
##font - The family attribute specifies the font of an element.
font-family can save multiple font names as a "fallback" system. If the browser doesn't support the first font, it will try the next one.
There are two types of font family names:
family-name - specified family name: the name of the specific font, such as: "times", "courier", "arial"
generic-family - Common font family names: such as: "serif", "sans-serif", "cursive", "fantasy", "monospace.
Use a specific font family ( Geneva) depends entirely on whether the font family is available on the user's machine; this attribute does not indicate any font download. Therefore, it is highly recommended to use a generic font family name as a fallback.
Note: Separate each value with a comma .
Note: If the font name contains spaces, it must be enclosed in quotes. When using the "style" attribute in HTML, single quotes must be used.
The above is the detailed content of How to use css font attribute. For more information, please follow other related articles on the PHP Chinese website!