English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Web safe fonts are extremely common fonts that are most likely to appear on various operating systems such as Windows, Mac, and Linux.
When the font you try to use on the web page does not appear as it should, it may be because not all computer systems provide all fonts.
To ensure accurate text rendering on most browsers or operating systems, you must define the font very carefully. Thefont-font-familyThe CSS 'font-family' property can accommodate several font names as fallback systems. It starts with the desired preferred font, and if the preferred font is not available, it uses the fallback font.
You should always use the generic font family as the 'font' attribute.-The value of the 'family' attribute, which includes five options: serif, sans-serif, monospace, cursive, and fantasy.-serif, monospace, cursive, and fantasy. If the font you defined is not available, the generic font family allows the browser to select a similar font.
The following table lists the font combinations that are safest to use.
Font family | Normal | Bold |
---|---|---|
Arial, Helvetica, sans-serif | This is regular text. | This is bold text. |
"Times New Roman", Times, serif | This is regular text. | This is bold text. |
"Courier New", Courier, monospace | This is regular text. | This is bold text. |
The following example shows how to use font-set the attribute correctly in the family.
.sans-serif-font { font-family: Arial, Helvetica, sans-serif; } .serif-font { font-family: "Times New Roman", Times, serif; } .monospace-font { font-family: "Courier New", Courier, monospace; }Test to see‹/›
The following table lists some commonly used font combinations organized by general series.
Font family | Normal | Bold |
---|---|---|
Georgia, serif | This is regular text. | This is bold text. |
"Times New Roman", Times, serif | This is regular text. | This is bold text. |
"Palatino Linotype", Palatino, "Book Antiqua", serif | This is regular text. | This is bold text. |
Font family | Normal | Bold |
---|---|---|
Arial, Helvetica, sans-serif | This is regular text. | This is bold text. |
"Arial Black", Gadget, sans-serif | This is regular text. | This is bold text. |
Impact, Charcoal, sans-serif | This is regular text. | This is bold text. |
Tahoma, Geneva, sans-serif | This is regular text. | This is bold text. |
"Trebuchet MS", Helvetica, sans-serif | This is regular text. | This is bold text. |
Verdana, Geneva, sans-serif | This is regular text. | This is bold text. |
Font family | Normal | Bold |
---|---|---|
Courier, monospace | This is regular text. | This is bold text. |
"Courier New", Courier, monospace | This is regular text. | This is bold text. |
"Lucida Console", Monaco, monospace | This is regular text. | This is bold text. |
Font family | Normal | Bold |
---|---|---|
"Comic Sans MS", cursive | This is regular text. | This is bold text. |
"Courier New", Courier, monospace | This is regular text. | This is bold text. |
"Lucida Console", Monaco, monospace | This is regular text. | This is bold text. |
There is no fantasy font that has good cross-browser and operating system availability.
Warning:Font (Verdana, Georgia, "Comic Sans MS", "Trebuchet MS", "Arial Black", Impact) is valid on Windows and MacOS, but not on Unix + X is invalid.